Author: metze
Date: 2006-03-06 13:55:56 +0000 (Mon, 06 Mar 2006)
New Revision: 13859

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13859

Log:
- remove useless fsync() calls
- make sure we only close the old_fd when the new one was opened

metze
Modified:
   branches/SAMBA_4_0/source/lib/util/debug.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/util/debug.c
===================================================================
--- branches/SAMBA_4_0/source/lib/util/debug.c  2006-03-06 13:22:16 UTC (rev 
13858)
+++ branches/SAMBA_4_0/source/lib/util/debug.c  2006-03-06 13:55:56 UTC (rev 
13859)
@@ -98,7 +98,6 @@
        va_end(ap);
 
        write(state.fd, s, strlen(s));
-       fsync(state.fd);
        free(s);
 }
 
@@ -130,6 +129,7 @@
                        int newfd = open(fname, O_CREAT|O_APPEND|O_WRONLY, 
0600);
                        if (newfd == -1) {
                                DEBUG(1, ("Failed to open new logfile: %s\n", 
fname));
+                               old_fd = -1;
                        } else {
                                state.fd = newfd;
                        }
@@ -142,7 +142,6 @@
        }
 
        if (old_fd > 2) {
-               fsync(old_fd);
                close(old_fd);
        }
 }

Reply via email to