git.samba.org
/
jelmer
/
samba4-debian.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7f2a6cf
)
r13859: - remove useless fsync() calls
author
Stefan Metzmacher
<metze@samba.org>
Mon, 6 Mar 2006 13:55:56 +0000
(13:55 +0000)
committer
Gerald (Jerry) Carter
<jerry@samba.org>
Wed, 10 Oct 2007 18:52:17 +0000
(13:52 -0500)
- make sure we only close the old_fd when the new one was opened
metze
source/lib/util/debug.c
patch
|
blob
|
history
diff --git
a/source/lib/util/debug.c
b/source/lib/util/debug.c
index e4f13ea28e69ae8e0284bd72b35a687de21833fe..65f8586eaa68e05e2aab5c2145de7bfafae4d4b3 100644
(file)
--- a/
source/lib/util/debug.c
+++ b/
source/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);
}
}