{
int fd;
struct flock lock;
-
const char *path = di->pid_file;
+
fd = open(path, O_RDWR);
if (fd != -1) {
memset(&lock, 0, sizeof(lock));
exit(1);
} else if (lock.l_type == F_WRLCK) {
flog_err_sys(LIB_ERR_SYSTEM_CALL,
- "Process %d has a write lock on file %s already! Error : ( %s)",
+ "Process %d has a write lock on file %s already! Error: (%s)",
lock.l_pid, path, safe_strerror(errno));
exit(1);
}
/* basename(), opencoded. */
char *p = strrchr(argv[0], '/');
-
di->progname = p ? p + 1 : argv[0];
umask(0027);