diff options
Diffstat (limited to 'sshd.c')
-rw-r--r-- | sshd.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshd.c,v 1.478 2016/11/30 00:28:31 dtucker Exp $ */ | 1 | /* $OpenBSD: sshd.c,v 1.479 2016/12/04 22:27:25 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -290,6 +290,8 @@ static void | |||
290 | sighup_restart(void) | 290 | sighup_restart(void) |
291 | { | 291 | { |
292 | logit("Received SIGHUP; restarting."); | 292 | logit("Received SIGHUP; restarting."); |
293 | if (options.pid_file != NULL) | ||
294 | unlink(options.pid_file); | ||
293 | platform_pre_restart(); | 295 | platform_pre_restart(); |
294 | close_listen_socks(); | 296 | close_listen_socks(); |
295 | close_startup_pipes(); | 297 | close_startup_pipes(); |
@@ -1841,7 +1843,7 @@ main(int ac, char **av) | |||
1841 | * Write out the pid file after the sigterm handler | 1843 | * Write out the pid file after the sigterm handler |
1842 | * is setup and the listen sockets are bound | 1844 | * is setup and the listen sockets are bound |
1843 | */ | 1845 | */ |
1844 | if (options.pid_file != NULL && !debug_flag && !already_daemon) { | 1846 | if (options.pid_file != NULL && !debug_flag) { |
1845 | FILE *f = fopen(options.pid_file, "w"); | 1847 | FILE *f = fopen(options.pid_file, "w"); |
1846 | 1848 | ||
1847 | if (f == NULL) { | 1849 | if (f == NULL) { |