diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2003-06-28 07:48:11 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2003-06-28 07:48:11 +0000 |
commit | 69e2f2ee2f9dcebe25a6bb216cd29ee90dc10018 (patch) | |
tree | 391ff609ae0b63a41c5d0ad73e43e6d9fa39d48c /usr.bin | |
parent | 2344053d2e7e14d1a0d4fb5f548b58c4190384b2 (diff) |
report pidfile creation errors, based on patch from Roumen Petrov; ok markus@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ssh/sshd.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c index 7fe8e8cb1aa..ce81810405b 100644 --- a/usr.bin/ssh/sshd.c +++ b/usr.bin/ssh/sshd.c @@ -42,7 +42,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshd.c,v 1.269 2003/06/24 08:23:46 markus Exp $"); +RCSID("$OpenBSD: sshd.c,v 1.270 2003/06/28 07:48:10 djm Exp $"); #include <openssl/dh.h> #include <openssl/bn.h> @@ -1161,7 +1161,10 @@ main(int ac, char **av) * overwrite any old pid in the file. */ f = fopen(options.pid_file, "w"); - if (f) { + if (f == NULL) { + error("Couldn't create pid file \"%s\": %s", + options.pid_file, strerror(errno)); + } else { fprintf(f, "%ld\n", (long) getpid()); fclose(f); } |