diff options
-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); } |