The following commit has been merged in the master branch:
commit d72022b1d3bbfe9871dab28d2db6ded7a268132e
Author: Guillem Jover <[email protected]>
Date: Sat Feb 26 17:52:47 2011 +0100
s-s-d: Do not unneedingly fsync() the pid file
The pid file is a run-time resource, which will not be valid on reboot
anyway. There's no need to guarantee its durability. But now that we are
not checking for errors from flushing the stream, check them instead
when closing it, which we should have been doing anyway.
diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c
index adeafae..4ea6b00 100644
--- a/utils/start-stop-daemon.c
+++ b/utils/start-stop-daemon.c
@@ -1595,11 +1595,8 @@ main(int argc, char **argv)
fatal("unable to open pidfile '%s' for writing",
pidfile);
fprintf(pidf, "%d\n", pidt);
- if (fflush(pidf))
- fatal("unable to flush pidfile '%s'", pidfile);
- if (fsync(fileno(pidf)))
- fatal("unable to sync pidfile '%s'", pidfile);
- fclose(pidf);
+ if (fclose(pidf))
+ fatal("unable to close pidfile '%s'", pidfile);
}
if (changeroot != NULL) {
if (chdir(changeroot) < 0)
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]