aboutsummaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorYaroslav Tykhiy <ytykhiy@gmail.com>2005-01-18 21:56:30 +0000
committerYaroslav Tykhiy <ytykhiy@gmail.com>2005-01-18 21:56:30 +0000
commit2456962edfef22b8d7638e6506c1a54eb9e557c9 (patch)
treecd60d72209634b7659f5b7ddea2b21689a50a490 /libexec
parent7d0e785ebf9941128402ba4598a02677d85b037a (diff)
Notes
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ftpd/ftpd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index a0ae0ba3e038..8a9954d23c28 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -452,14 +452,18 @@ main(int argc, char *argv[], char **envp)
| O_NONBLOCK | O_EXLOCK, 0644);
if (fd < 0) {
if (errno == EAGAIN)
- errx(1, "%s: file locked", pid_file);
+ syslog(LOG_ERR,
+ "%s: already locked", pid_file);
else
- err(1, "%s", pid_file);
+ syslog(LOG_ERR, "%s: %m", pid_file);
+ exit(1);
}
snprintf(buf, sizeof(buf),
"%lu\n", (unsigned long) getpid());
- if (write(fd, buf, strlen(buf)) < 0)
- err(1, "%s: write", pid_file);
+ if (write(fd, buf, strlen(buf)) < 0) {
+ syslog(LOG_ERR, "%s: write: %m", pid_file);
+ exit(1);
+ }
/* Leave the pid file open and locked */
}
/*