diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index cbb2a8784e2..79d9d6cb0ca 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