30_fix-excessive-sync.patch 862 Bytes
Newer Older
1 2
Description: remove excessive sync calls causing lots of disk activity and
             replace by fsync on closing the file.
3
Bug: http://bugs.debian.org/623140
4 5
Author: Nico Golde <nion@debian.org>
Last-Update: 2011-04-19
6 7
Index: tcpxtract-1.0.1/extract.c
===================================================================
8 9 10
--- tcpxtract-1.0.1.orig/extract.c
+++ tcpxtract-1.0.1/extract.c
@@ -163,7 +163,6 @@ static void extract_segment(extract_list
11 12 13 14 15 16 17
         error("Quiting.");
     }
     elist->nwritten += nbytes;
-    sync();
 }
 
 /* remove all finished extracts from the list */
18
@@ -182,6 +181,8 @@ static void sweep_extract_list(extract_l
19 20 21 22 23 24 25 26
                 eptr->next->prev = eptr->prev;
             if (*elist == eptr)
                 *elist = eptr->next;
+
+            fsync(eptr->fd);
             close(eptr->fd);
             free(eptr);
         }