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@ --- ChangeLog | 9 ++++++++- sshd.c | 7 +++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index f40631cf8..130989988 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +20030703 + - (dtucker) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2003/06/28 07:48:10 + [sshd.c] + report pidfile creation errors, based on patch from Roumen Petrov; + ok markus@ + 20030630 - (djm) Search for support functions necessary to build our getrrsetbyname() replacement. Patch from Roumen Petrov @@ -617,4 +624,4 @@ - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. Report from murple@murple.net, diagnosis from dtucker@zip.com.au -$Id: ChangeLog,v 1.2835 2003/06/30 09:21:36 djm Exp $ +$Id: ChangeLog,v 1.2836 2003/07/03 03:40:44 dtucker Exp $ 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