From 1232ea27c43a1d402f7b480dff925ed1768ff946 Mon Sep 17 00:00:00 2001 From: elad Date: Sat, 7 Oct 2006 17:27:57 +0000 Subject: [PATCH] PR/18906: roskens at elfin dot net: misc. select() to poll() updates. Adapted to -current by myself, thanks for the patch! --- games/hunt/huntd/driver.c | 10 +++++----- usr.bin/talk/io.c | 6 +++--- usr.bin/telnet/tn3270.c | 6 +++--- usr.bin/telnet/utilities.c | 6 +++--- usr.bin/tn3270/sys_curses/system.c | 6 +++--- usr.bin/top/top.c | 6 +++--- usr.sbin/apmd/apmd.c | 4 ++-- usr.sbin/mopd/common/loop-bsd.c | 8 ++++---- usr.sbin/nfsd/nfsd.c | 6 +++--- usr.sbin/route6d/route6d.c | 6 +++--- usr.sbin/rtadvd/rtadvd.c | 4 ++-- usr.sbin/rtsold/rtsold.c | 4 ++-- usr.sbin/traceroute/traceroute.c | 6 +++--- 13 files changed, 39 insertions(+), 39 deletions(-) diff --git a/games/hunt/huntd/driver.c b/games/hunt/huntd/driver.c index 9deaa5253d90..515e4d6d01e6 100644 --- a/games/hunt/huntd/driver.c +++ b/games/hunt/huntd/driver.c @@ -1,4 +1,4 @@ -/* $NetBSD: driver.c,v 1.11 2006/05/09 20:18:06 mrg Exp $ */ +/* $NetBSD: driver.c,v 1.12 2006/10/07 17:27:57 elad Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. * All rights reserved. @@ -32,7 +32,7 @@ #include #ifndef lint -__RCSID("$NetBSD: driver.c,v 1.11 2006/05/09 20:18:06 mrg Exp $"); +__RCSID("$NetBSD: driver.c,v 1.12 2006/10/07 17:27:57 elad Exp $"); #endif /* not lint */ # include @@ -135,9 +135,9 @@ again: { if (errno != EINTR) # ifdef LOG - syslog(LOG_WARNING, "select: %m"); + syslog(LOG_WARNING, "poll: %m"); # else - warn("select"); + warn("poll"); # endif errno = 0; } @@ -378,7 +378,7 @@ init() # endif /* - * Initialize minimal select mask + * Initialize minimal poll mask */ fdset[0].fd = Socket; fdset[0].events = POLLIN; diff --git a/usr.bin/talk/io.c b/usr.bin/talk/io.c index b6add2e52175..35f014118c02 100644 --- a/usr.bin/talk/io.c +++ b/usr.bin/talk/io.c @@ -1,4 +1,4 @@ -/* $NetBSD: io.c,v 1.11 2006/03/18 03:40:51 ginsbach Exp $ */ +/* $NetBSD: io.c,v 1.12 2006/10/07 17:27:57 elad Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 6/6/93"; #endif -__RCSID("$NetBSD: io.c,v 1.11 2006/03/18 03:40:51 ginsbach Exp $"); +__RCSID("$NetBSD: io.c,v 1.12 2006/10/07 17:27:57 elad Exp $"); #endif /* not lint */ /* @@ -81,7 +81,7 @@ talk() if (errno == EINTR) continue; /* panic, we don't know what happened */ - p_error("Unexpected error from select"); + p_error("Unexpected error from poll"); quit(); } if (set[0].revents & POLLIN) { diff --git a/usr.bin/telnet/tn3270.c b/usr.bin/telnet/tn3270.c index 7fec884cc091..7e7ad665a821 100644 --- a/usr.bin/telnet/tn3270.c +++ b/usr.bin/telnet/tn3270.c @@ -1,4 +1,4 @@ -/* $NetBSD: tn3270.c,v 1.21 2003/08/07 11:16:12 agc Exp $ */ +/* $NetBSD: tn3270.c,v 1.22 2006/10/07 17:27:57 elad Exp $ */ /* * Copyright (c) 1988, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)tn3270.c 8.2 (Berkeley) 5/30/95"; #else -__RCSID("$NetBSD: tn3270.c,v 1.21 2003/08/07 11:16:12 agc Exp $"); +__RCSID("$NetBSD: tn3270.c,v 1.22 2006/10/07 17:27:57 elad Exp $"); #endif #endif /* not lint */ @@ -186,7 +186,7 @@ outputPurge(void) * DataToTerminal - queue up some data to go to terminal. * * Note: there are people who call us and depend on our processing - * *all* the data at one time (thus the select). + * *all* the data at one time (thus the poll). */ int diff --git a/usr.bin/telnet/utilities.c b/usr.bin/telnet/utilities.c index 6629b7c368ed..c01d83e3bf53 100644 --- a/usr.bin/telnet/utilities.c +++ b/usr.bin/telnet/utilities.c @@ -1,4 +1,4 @@ -/* $NetBSD: utilities.c,v 1.21 2005/02/06 20:39:35 dsl Exp $ */ +/* $NetBSD: utilities.c,v 1.22 2006/10/07 17:27:57 elad Exp $ */ /* * Copyright (c) 1988, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)utilities.c 8.3 (Berkeley) 5/30/95"; #else -__RCSID("$NetBSD: utilities.c,v 1.21 2005/02/06 20:39:35 dsl Exp $"); +__RCSID("$NetBSD: utilities.c,v 1.22 2006/10/07 17:27:57 elad Exp $"); #endif #endif /* not lint */ @@ -860,7 +860,7 @@ printsub( /* EmptyTerminal - called to make sure that the terminal buffer is empty. * Note that we consider the buffer to run all the - * way to the kernel (thus the select). + * way to the kernel (thus the poll). */ void diff --git a/usr.bin/tn3270/sys_curses/system.c b/usr.bin/tn3270/sys_curses/system.c index 1e9db9d3b64d..257cf7db34ec 100644 --- a/usr.bin/tn3270/sys_curses/system.c +++ b/usr.bin/tn3270/sys_curses/system.c @@ -1,4 +1,4 @@ -/* $NetBSD: system.c,v 1.20 2006/05/11 00:27:27 mrg Exp $ */ +/* $NetBSD: system.c,v 1.21 2006/10/07 17:27:57 elad Exp $ */ /*- * Copyright (c) 1988 The Regents of the University of California. @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)system.c 4.5 (Berkeley) 4/26/91"; #else -__RCSID("$NetBSD: system.c,v 1.20 2006/05/11 00:27:27 mrg Exp $"); +__RCSID("$NetBSD: system.c,v 1.21 2006/10/07 17:27:57 elad Exp $"); #endif #endif /* not lint */ @@ -479,7 +479,7 @@ doconnect() if (errno == EINTR) { continue; } else { - perror("in select waiting for API connection"); + perror("in poll waiting for API connection"); return -1; } } else { diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c index 5508a4f816e9..13a4a04c45d9 100644 --- a/usr.bin/top/top.c +++ b/usr.bin/top/top.c @@ -1,4 +1,4 @@ -/* $NetBSD: top.c,v 1.23 2005/10/03 05:34:51 christos Exp $ */ +/* $NetBSD: top.c,v 1.24 2006/10/07 17:27:57 elad Exp $ */ const char copyright[] = "Copyright (c) 1984 through 1996, William LeFebvre"; @@ -49,7 +49,7 @@ const char copyright[] = "Copyright (c) 1984 through 1996, William LeFebvre"; #include #ifndef lint -__RCSID("$NetBSD: top.c,v 1.23 2005/10/03 05:34:51 christos Exp $"); +__RCSID("$NetBSD: top.c,v 1.24 2006/10/07 17:27:57 elad Exp $"); #endif #include "os.h" @@ -626,7 +626,7 @@ Usage: %s [-bIinqSuv] [-d count] [-o field] [-s time] [-U username] [number]\n", /* assume valid command unless told otherwise */ no_command = No; - /* set up arguments for select with timeout */ + /* set up arguments for poll with timeout */ set[0].fd = 0; set[0].events = POLLIN; diff --git a/usr.sbin/apmd/apmd.c b/usr.sbin/apmd/apmd.c index 397cdc5ce1e5..3700eb6f6a08 100644 --- a/usr.sbin/apmd/apmd.c +++ b/usr.sbin/apmd/apmd.c @@ -1,4 +1,4 @@ -/* $NetBSD: apmd.c,v 1.29 2006/05/09 20:18:09 mrg Exp $ */ +/* $NetBSD: apmd.c,v 1.30 2006/10/07 17:27:57 elad Exp $ */ /*- * Copyright (c) 1996, 2000 The NetBSD Foundation, Inc. @@ -526,7 +526,7 @@ main(int argc, char *argv[]) } } } - syslog(LOG_ERR, "select failed: %m"); + syslog(LOG_ERR, "poll failed: %m"); exit(1); } diff --git a/usr.sbin/mopd/common/loop-bsd.c b/usr.sbin/mopd/common/loop-bsd.c index 6443e93c28f3..788f7335bc97 100644 --- a/usr.sbin/mopd/common/loop-bsd.c +++ b/usr.sbin/mopd/common/loop-bsd.c @@ -1,4 +1,4 @@ -/* $NetBSD: loop-bsd.c,v 1.8 2006/05/25 00:27:56 christos Exp $ */ +/* $NetBSD: loop-bsd.c,v 1.9 2006/10/07 17:27:57 elad Exp $ */ /* * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: loop-bsd.c,v 1.8 2006/05/25 00:27:56 christos Exp $"); +__RCSID("$NetBSD: loop-bsd.c,v 1.9 2006/10/07 17:27:57 elad Exp $"); #endif #include @@ -94,7 +94,7 @@ mopReadDL() /* * The list of all interfaces that are being listened to. loop() - * "selects" on the descriptors in this list. + * "polls" on the descriptors in this list. */ struct if_info *iflist; @@ -124,7 +124,7 @@ Loop() if (buf == 0) mopLogErr("malloc"); /* - * Find the highest numbered file descriptor for select(). + * Find the highest numbered file descriptor for poll(). * Initialize the set of descriptors to listen to. */ for (ii = iflist, n = 0; ii; ii = ii->next, n++) diff --git a/usr.sbin/nfsd/nfsd.c b/usr.sbin/nfsd/nfsd.c index 524cf52b5d70..461f4fe5043d 100644 --- a/usr.sbin/nfsd/nfsd.c +++ b/usr.sbin/nfsd/nfsd.c @@ -1,4 +1,4 @@ -/* $NetBSD: nfsd.c,v 1.48 2006/08/25 11:59:30 hubertf Exp $ */ +/* $NetBSD: nfsd.c,v 1.49 2006/10/07 17:27:57 elad Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993, 1994\n\ #if 0 static char sccsid[] = "@(#)nfsd.c 8.9 (Berkeley) 3/29/95"; #else -__RCSID("$NetBSD: nfsd.c,v 1.48 2006/08/25 11:59:30 hubertf Exp $"); +__RCSID("$NetBSD: nfsd.c,v 1.49 2006/10/07 17:27:57 elad Exp $"); #endif #endif /* not lint */ @@ -615,7 +615,7 @@ main(argc, argv) */ for (;;) { if (poll(set, 4, INFTIM) < 1) { - syslog(LOG_ERR, "select failed: %m"); + syslog(LOG_ERR, "poll failed: %m"); exit(1); } diff --git a/usr.sbin/route6d/route6d.c b/usr.sbin/route6d/route6d.c index 8a2766d99460..7ba7bed411d9 100644 --- a/usr.sbin/route6d/route6d.c +++ b/usr.sbin/route6d/route6d.c @@ -1,4 +1,4 @@ -/* $NetBSD: route6d.c,v 1.58 2006/05/25 02:40:58 rpaulo Exp $ */ +/* $NetBSD: route6d.c,v 1.59 2006/10/07 17:27:57 elad Exp $ */ /* $KAME: route6d.c,v 1.94 2002/10/26 20:08:55 itojun Exp $ */ /* @@ -32,7 +32,7 @@ #include #ifndef lint -__RCSID("$NetBSD: route6d.c,v 1.58 2006/05/25 02:40:58 rpaulo Exp $"); +__RCSID("$NetBSD: route6d.c,v 1.59 2006/10/07 17:27:57 elad Exp $"); #endif #include @@ -455,7 +455,7 @@ main(int argc, char **argv) { case -1: if (errno != EINTR) { - fatal("select"); + fatal("poll"); /*NOTREACHED*/ } continue; diff --git a/usr.sbin/rtadvd/rtadvd.c b/usr.sbin/rtadvd/rtadvd.c index 99209e0d3627..1034d1a00c11 100644 --- a/usr.sbin/rtadvd/rtadvd.c +++ b/usr.sbin/rtadvd/rtadvd.c @@ -1,4 +1,4 @@ -/* $NetBSD: rtadvd.c,v 1.32 2006/08/02 13:44:53 tron Exp $ */ +/* $NetBSD: rtadvd.c,v 1.33 2006/10/07 17:27:57 elad Exp $ */ /* $KAME: rtadvd.c,v 1.92 2005/10/17 14:40:02 suz Exp $ */ /* @@ -272,7 +272,7 @@ main(argc, argv) timeout->tv_usec / 1000) : INFTIM)) < 0) { /* EINTR would occur upon SIGUSR1 for status dump */ if (errno != EINTR) - syslog(LOG_ERR, "<%s> select: %s", + syslog(LOG_ERR, "<%s> poll: %s", __func__, strerror(errno)); continue; } diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c index e9083ce7aea8..2b2553e96988 100644 --- a/usr.sbin/rtsold/rtsold.c +++ b/usr.sbin/rtsold/rtsold.c @@ -1,4 +1,4 @@ -/* $NetBSD: rtsold.c,v 1.32 2006/05/11 08:38:38 mrg Exp $ */ +/* $NetBSD: rtsold.c,v 1.33 2006/10/07 17:27:57 elad Exp $ */ /* $KAME: rtsold.c,v 1.77 2004/01/03 01:35:13 itojun Exp $ */ /* @@ -296,7 +296,7 @@ main(int argc, char **argv) e = poll(set, 2, timeout ? (timeout->tv_sec * 1000 + timeout->tv_usec / 1000) : INFTIM); if (e < 1) { if (e < 0 && errno != EINTR) { - warnmsg(LOG_ERR, __func__, "select: %s", + warnmsg(LOG_ERR, __func__, "poll: %s", strerror(errno)); } continue; diff --git a/usr.sbin/traceroute/traceroute.c b/usr.sbin/traceroute/traceroute.c index 6b1ef792d9a9..b4757bef2dd8 100644 --- a/usr.sbin/traceroute/traceroute.c +++ b/usr.sbin/traceroute/traceroute.c @@ -1,4 +1,4 @@ -/* $NetBSD: traceroute.c,v 1.67 2006/10/07 10:23:33 elad Exp $ */ +/* $NetBSD: traceroute.c,v 1.68 2006/10/07 17:27:57 elad Exp $ */ /* * Copyright (c) 1988, 1989, 1991, 1994, 1995, 1996, 1997 @@ -29,7 +29,7 @@ static const char rcsid[] = #else __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1991, 1994, 1995, 1996, 1997\n\ The Regents of the University of California. All rights reserved.\n"); -__RCSID("$NetBSD: traceroute.c,v 1.67 2006/10/07 10:23:33 elad Exp $"); +__RCSID("$NetBSD: traceroute.c,v 1.68 2006/10/07 17:27:57 elad Exp $"); #endif #endif @@ -1103,7 +1103,7 @@ wait_for_reply(int sock, struct sockaddr_in *fromp, struct timeval *tp) retval = poll(set, 1, wait.tv_sec * 1000 + wait.tv_usec / 1000); if (retval < 0) { /* If we continue, we probably just flood the remote host. */ - Fprintf(stderr, "%s: select: %s\n", prog, strerror(errno)); + Fprintf(stderr, "%s: poll: %s\n", prog, strerror(errno)); exit(1); } if (retval > 0) {