Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
9048175
)
Better pid handling.
author
Wayne Davison
<wayned@samba.org>
Tue, 27 Jan 2004 07:57:12 +0000
(07:57 +0000)
committer
Wayne Davison
<wayned@samba.org>
Tue, 27 Jan 2004 07:57:12 +0000
(07:57 +0000)
clientserver.c
patch
|
blob
|
blame
|
history
diff --git
a/clientserver.c
b/clientserver.c
index
963d9fe
..
a2bbfe8
100644
(file)
--- a/
clientserver.c
+++ b/
clientserver.c
@@
-614,7
+614,7
@@
int daemon_main(void)
if (((pid_file = lp_pid_file()) != NULL) && (*pid_file != '\0')) {
char pidbuf[16];
int fd;
if (((pid_file = lp_pid_file()) != NULL) && (*pid_file != '\0')) {
char pidbuf[16];
int fd;
-
int pid = (int)
getpid();
+
pid_t pid =
getpid();
cleanup_set_pid(pid);
if ((fd = do_open(lp_pid_file(), O_WRONLY|O_CREAT|O_TRUNC,
0666 & ~orig_umask)) == -1) {
cleanup_set_pid(pid);
if ((fd = do_open(lp_pid_file(), O_WRONLY|O_CREAT|O_TRUNC,
0666 & ~orig_umask)) == -1) {
@@
-622,7
+622,7
@@
int daemon_main(void)
rsyserr(FLOG, errno, "failed to create pid file %s", pid_file);
exit_cleanup(RERR_FILEIO);
}
rsyserr(FLOG, errno, "failed to create pid file %s", pid_file);
exit_cleanup(RERR_FILEIO);
}
- snprintf(pidbuf, sizeof
(pidbuf), "%d\n",
pid);
+ snprintf(pidbuf, sizeof
pidbuf, "%ld\n", (long)
pid);
write(fd, pidbuf, strlen(pidbuf));
close(fd);
}
write(fd, pidbuf, strlen(pidbuf));
close(fd);
}