diff options
author | David Dykstra <dwd@samba.org> | 1998-10-26 21:51:47 +0000 |
---|---|---|
committer | David Dykstra <dwd@samba.org> | 1998-10-26 21:51:47 +0000 |
commit | 8638dd48f71023642d3af282250bbe157ee9b67d (patch) | |
tree | dc7775fc863e859a3aed08bdbc88bd1ef4886c45 /cleanup.c | |
parent | 2bca43f6278dcc0aa19a2620c1f1e2387b2e7b07 (diff) | |
download | android_external_rsync-8638dd48f71023642d3af282250bbe157ee9b67d.tar.gz android_external_rsync-8638dd48f71023642d3af282250bbe157ee9b67d.tar.bz2 android_external_rsync-8638dd48f71023642d3af282250bbe157ee9b67d.zip |
Add "use chroot" and "pid file" rsyncd.conf options. The former allows one
to disable the use of chroot so rsync --daemon can be run as a non-root
user (if a non-privileged --port is used). The latter allows one to
specify a file in which to write the process id of the daemon, which is
useful when rsync --daemon is not run from inetd.
Diffstat (limited to 'cleanup.c')
-rw-r--r-- | cleanup.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -29,6 +29,7 @@ static char *cleanup_new_fname; static struct file_struct *cleanup_file; static int cleanup_fd1, cleanup_fd2; static struct map_struct *cleanup_buf; +static int cleanup_pid = 0; void exit_cleanup(int code) { @@ -50,6 +51,8 @@ void exit_cleanup(int code) if (code) { kill_all(SIGUSR1); } + if ((cleanup_pid != 0) && (cleanup_pid == (int) getpid())) + unlink(lp_pid_file()); exit(code); } @@ -70,3 +73,8 @@ void cleanup_set(char *fnametmp, char *fname, struct file_struct *file, cleanup_fd1 = fd1; cleanup_fd2 = fd2; } + +void cleanup_set_pid(int pid) +{ + cleanup_pid = pid; +} |