summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-03-06 13:55:56 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:52:17 -0500
commit1c49d8f794762d0f3828237961012761212cb37e (patch)
tree2ee7c0fedda17f02a5770f1a2b409fbd05488be1 /source4/lib
parent1bff329dff79ca7dacc7e60068233462689fa3f7 (diff)
downloadsamba-1c49d8f794762d0f3828237961012761212cb37e.tar.gz
samba-1c49d8f794762d0f3828237961012761212cb37e.tar.bz2
samba-1c49d8f794762d0f3828237961012761212cb37e.zip
r13859: - remove useless fsync() calls
- make sure we only close the old_fd when the new one was opened metze (This used to be commit 3a6568c3669286d41343293c29c8d00fa78c372f)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/util/debug.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/source4/lib/util/debug.c b/source4/lib/util/debug.c
index e4f13ea28e..65f8586eaa 100644
--- a/source4/lib/util/debug.c
+++ b/source4/lib/util/debug.c
@@ -98,7 +98,6 @@ _PUBLIC_ void do_debug(const char *format, ...) _PRINTF_ATTRIBUTE(1,2)
va_end(ap);
write(state.fd, s, strlen(s));
- fsync(state.fd);
free(s);
}
@@ -130,6 +129,7 @@ _PUBLIC_ void reopen_logs(void)
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 @@ _PUBLIC_ void reopen_logs(void)
}
if (old_fd > 2) {
- fsync(old_fd);
close(old_fd);
}
}