diff options
| author | Mateusz Guzik <mjg@FreeBSD.org> | 2022-03-11 11:02:28 +0000 |
|---|---|---|
| committer | Mateusz Guzik <mjg@FreeBSD.org> | 2022-04-09 15:59:43 +0000 |
| commit | a3214fbe7fff8b4914f12e187dcc972e52db548d (patch) | |
| tree | 8d567c66803878c5894f1c6b490fa2542da3681f /sbin | |
| parent | 287451fd019299b138bab2ee99cdf0f3be495439 (diff) | |
Diffstat (limited to 'sbin')
| -rw-r--r-- | sbin/mount/mount.c | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index cbb2a8784e26..79d9d6cb0caf 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -207,33 +207,8 @@ specified_ro(const char *arg) static void restart_mountd(void) { - struct pidfh *pfh; - pid_t mountdpid; - mountdpid = 0; - pfh = pidfile_open(_PATH_MOUNTDPID, 0600, &mountdpid); - if (pfh != NULL) { - /* Mountd is not running. */ - pidfile_remove(pfh); - return; - } - if (errno != EEXIST) { - /* Cannot open pidfile for some reason. */ - return; - } - - /* - * Refuse to send broadcast or group signals, this has - * happened due to the bugs in pidfile(3). - */ - if (mountdpid <= 0) { - xo_warnx("mountd pid %d, refusing to send SIGHUP", mountdpid); - return; - } - - /* We have mountd(8) PID in mountdpid varible, let's signal it. */ - if (kill(mountdpid, SIGHUP) == -1) - xo_err(1, "signal mountd"); + pidfile_signal(_PATH_MOUNTDPID, SIGHUP, NULL); } int |
