module_id = i;
- am_root = (getuid() == 0);
+ am_root = (MY_UID() == 0);
if (am_root) {
p = lp_uid(i);
return -1;
}
- am_root = (getuid() == 0);
+ am_root = (MY_UID() == 0);
}
io_printf(f_out, "@RSYNCD: OK\n");
#ifndef DEBUG
/* don't allow the logs to be flooded too fast */
- if (verbose > 1) verbose = 1;
+ if (verbose > lp_max_verbosity())
+ verbose = lp_max_verbosity();
#endif
if (protocol_version < 23) {
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) {
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);
}