=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/sshd.c,v retrieving revision 1.478 retrieving revision 1.479 diff -u -r1.478 -r1.479 --- src/usr.bin/ssh/sshd.c 2016/11/30 00:28:31 1.478 +++ src/usr.bin/ssh/sshd.c 2016/12/04 22:27:25 1.479 @@ -1,4 +1,4 @@ -/* $OpenBSD: sshd.c,v 1.478 2016/11/30 00:28:31 dtucker Exp $ */ +/* $OpenBSD: sshd.c,v 1.479 2016/12/04 22:27:25 dtucker Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -268,6 +268,8 @@ sighup_restart(void) { logit("Received SIGHUP; restarting."); + if (options.pid_file != NULL) + unlink(options.pid_file); close_listen_socks(); close_startup_pipes(); alarm(0); /* alarm timer persists across exec */ @@ -1702,7 +1704,7 @@ * Write out the pid file after the sigterm handler * is setup and the listen sockets are bound */ - if (options.pid_file != NULL && !debug_flag && !already_daemon) { + if (options.pid_file != NULL && !debug_flag) { FILE *f = fopen(options.pid_file, "w"); if (f == NULL) {