From e53270481c279cb50cf31bc83dc6c91835f9a524 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 3 Jul 2003 13:40:44 +1000 Subject: - djm@cvs.openbsd.org 2003/06/28 07:48:10 [sshd.c] report pidfile creation errors, based on patch from Roumen Petrov; ok markus@ --- sshd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sshd.c') diff --git a/sshd.c b/sshd.c index b8f360841..b4cdc724a 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 #include @@ -1217,7 +1217,10 @@ main(int ac, char **av) * 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); } -- cgit v1.2.3