summaryrefslogtreecommitdiff
path: root/usr.sbin/ntpd/ntp.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2015-05-20 13:32:40 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2015-05-20 13:32:40 +0000
commitf28c40a766a6ea5e5392d173c3b80944660299de (patch)
tree446f1494b9cd311c146efe0c7cc15d7132c13c61 /usr.sbin/ntpd/ntp.c
parenta1bb22e082bc6c044f3cc6766b287df2dd17a740 (diff)
Remove hotplug(4) sensor support: the code has been disabled by
henning@ 9 years ago because of an issue with the /dev/hotplug device - it does not support multiple readers opening it. Nobody ever cared enough to fix it so it is time to sent the dead code to the Attic. OK henning@ (feeling sad about it), mpi@ and others
Diffstat (limited to 'usr.sbin/ntpd/ntp.c')
-rw-r--r--usr.sbin/ntpd/ntp.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/usr.sbin/ntpd/ntp.c b/usr.sbin/ntpd/ntp.c
index 9837d8a4ec1..72f6c96be1e 100644
--- a/usr.sbin/ntpd/ntp.c
+++ b/usr.sbin/ntpd/ntp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntp.c,v 1.130 2015/03/02 10:31:17 bcook Exp $ */
+/* $OpenBSD: ntp.c,v 1.131 2015/05/20 13:32:39 reyk Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -35,10 +35,9 @@
#include "ntpd.h"
#define PFD_PIPE_MAIN 0
-#define PFD_HOTPLUG 1
-#define PFD_PIPE_DNS 2
-#define PFD_SOCK_CTL 3
-#define PFD_MAX 4
+#define PFD_PIPE_DNS 1
+#define PFD_SOCK_CTL 2
+#define PFD_MAX 3
volatile sig_atomic_t ntp_quit = 0;
volatile sig_atomic_t ntp_report = 0;
@@ -81,7 +80,7 @@ ntp_main(int pipe_prnt[2], int fd_ctl, struct ntpd_conf *nconf,
struct passwd *pw)
{
int a, b, nfds, i, j, idx_peers, timeout;
- int hotplugfd, nullfd, pipe_dns[2], idx_clients;
+ int nullfd, pipe_dns[2], idx_clients;
int ctls;
u_int pfd_elms = 0, idx2peer_elms = 0;
u_int listener_cnt, new_cnt, sent_cnt, trial_cnt;
@@ -128,7 +127,6 @@ ntp_main(int pipe_prnt[2], int fd_ctl, struct ntpd_conf *nconf,
if ((nullfd = open(_PATH_DEVNULL, O_RDWR, 0)) == -1)
fatal(NULL);
- hotplugfd = sensor_hotplugfd();
close(pipe_prnt[0]);
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pipe_dns) == -1)
@@ -253,8 +251,6 @@ ntp_main(int pipe_prnt[2], int fd_ctl, struct ntpd_conf *nconf,
nextaction = getmonotime() + 3600;
pfd[PFD_PIPE_MAIN].fd = ibuf_main->fd;
pfd[PFD_PIPE_MAIN].events = POLLIN;
- pfd[PFD_HOTPLUG].fd = hotplugfd;
- pfd[PFD_HOTPLUG].events = POLLIN;
pfd[PFD_PIPE_DNS].fd = ibuf_dns->fd;
pfd[PFD_PIPE_DNS].events = POLLIN;
pfd[PFD_SOCK_CTL].fd = fd_ctl;
@@ -406,11 +402,6 @@ ntp_main(int pipe_prnt[2], int fd_ctl, struct ntpd_conf *nconf,
ctl_cnt += control_accept(fd_ctl);
}
- if (nfds > 0 && pfd[PFD_HOTPLUG].revents & (POLLIN|POLLERR)) {
- nfds--;
- sensor_hotplugevent(hotplugfd);
- }
-
for (j = PFD_MAX; nfds > 0 && j < idx_peers; j++)
if (pfd[j].revents & (POLLIN|POLLERR)) {
nfds--;