gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r25995 - Extractor/src/plugins


From: gnunet
Subject: [GNUnet-SVN] r25995 - Extractor/src/plugins
Date: Sun, 3 Feb 2013 18:56:41 +0100

Author: LRN
Date: 2013-02-03 18:56:41 +0100 (Sun, 03 Feb 2013)
New Revision: 25995

Modified:
   Extractor/src/plugins/flac_extractor.c
Log:
Fix eof detection in flac plugin

Prevents it from busylooping forever when parent process suddenly dies.

Modified: Extractor/src/plugins/flac_extractor.c
===================================================================
--- Extractor/src/plugins/flac_extractor.c      2013-02-03 17:17:43 UTC (rev 
25994)
+++ Extractor/src/plugins/flac_extractor.c      2013-02-03 17:56:41 UTC (rev 
25995)
@@ -150,9 +150,17 @@
          void *client_data) 
 {
   struct EXTRACTOR_ExtractContext *ec = client_data;
+  uint64_t size;
+  int64_t seekresult;
+  size = ec->get_size (ec->cls);
+  seekresult = ec->seek (ec->cls, 0, SEEK_CUR);
 
-  return (ec->get_size (ec->cls) == 
-         ec->seek (ec->cls, 0, SEEK_CUR)) ? true : false;
+  if (seekresult == -1)
+    /* Treat seek error as error (not as indication of file not being
+     * seekable).
+     */
+    return true;
+  return (size == seekresult) ? true : false;
 }
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]