- djm@cvs.openbsd.org 2003/06/28 07:48:10
[sshd.c]
report pidfile creation errors, based on patch from Roumen Petrov; ok markus@
diff --git a/sshd.c b/sshd.c
index b8f3608..b4cdc72 100644
--- a/sshd.c
+++ b/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>
@@ -1217,7 +1217,10 @@
* overwrite any old pid in the file.
*/
f = fopen(options.pid_file, "wb");
- 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);
}