diff options
author | Darren Tucker <dtucker@zip.com.au> | 2003-07-03 13:40:44 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2003-07-03 13:40:44 +1000 |
commit | e53270481c279cb50cf31bc83dc6c91835f9a524 (patch) | |
tree | bad2409e6ceed58fd67c06974791da391911b2d4 /sshd.c | |
parent | 200d0a7bf58f5ef3679d2bab1824ac4fcc5a088f (diff) |
- djm@cvs.openbsd.org 2003/06/28 07:48:10
[sshd.c]
report pidfile creation errors, based on patch from Roumen Petrov; ok markus@
Diffstat (limited to 'sshd.c')
-rw-r--r-- | sshd.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -42,7 +42,7 @@ | |||
42 | */ | 42 | */ |
43 | 43 | ||
44 | #include "includes.h" | 44 | #include "includes.h" |
45 | RCSID("$OpenBSD: sshd.c,v 1.269 2003/06/24 08:23:46 markus Exp $"); | 45 | RCSID("$OpenBSD: sshd.c,v 1.270 2003/06/28 07:48:10 djm Exp $"); |
46 | 46 | ||
47 | #include <openssl/dh.h> | 47 | #include <openssl/dh.h> |
48 | #include <openssl/bn.h> | 48 | #include <openssl/bn.h> |
@@ -1217,7 +1217,10 @@ main(int ac, char **av) | |||
1217 | * overwrite any old pid in the file. | 1217 | * overwrite any old pid in the file. |
1218 | */ | 1218 | */ |
1219 | f = fopen(options.pid_file, "wb"); | 1219 | f = fopen(options.pid_file, "wb"); |
1220 | if (f) { | 1220 | if (f == NULL) { |
1221 | error("Couldn't create pid file \"%s\": %s", | ||
1222 | options.pid_file, strerror(errno)); | ||
1223 | } else { | ||
1221 | fprintf(f, "%ld\n", (long) getpid()); | 1224 | fprintf(f, "%ld\n", (long) getpid()); |
1222 | fclose(f); | 1225 | fclose(f); |
1223 | } | 1226 | } |