summaryrefslogtreecommitdiffstats
path: root/gnu/libexec/uucp/libunix/pause.c
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/libexec/uucp/libunix/pause.c')
-rw-r--r--gnu/libexec/uucp/libunix/pause.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/gnu/libexec/uucp/libunix/pause.c b/gnu/libexec/uucp/libunix/pause.c
index 8155db3..8b2b698 100644
--- a/gnu/libexec/uucp/libunix/pause.c
+++ b/gnu/libexec/uucp/libunix/pause.c
@@ -7,27 +7,29 @@
#include "system.h"
/* Pick a timing routine to use. I somewhat arbitrarily picked usleep
- above nap above napms above poll above select. */
-#if HAVE_USLEEP || HAVE_NAP || HAVE_NAPMS || HAVE_POLL
+ above napms above poll above select above nap. The nap function is
+ last because on different systems the argument has different
+ meanings. */
+#if HAVE_USLEEP || HAVE_NAPMS || HAVE_POLL || HAVE_SELECT
+#undef HAVE_NAP
+#define HAVE_NAP 0
+#endif
+
+#if HAVE_USLEEP || HAVE_NAPMS || HAVE_POLL
#undef HAVE_SELECT
#define HAVE_SELECT 0
#endif
-#if HAVE_USLEEP || HAVE_NAP || HAVE_NAPMS
+#if HAVE_USLEEP || HAVE_NAPMS
#undef HAVE_POLL
#define HAVE_POLL 0
#endif
-#if HAVE_USLEEP || HAVE_NAP
+#if HAVE_USLEEP
#undef HAVE_NAPMS
#define HAVE_NAPMS 0
#endif
-#if HAVE_USLEEP
-#undef HAVE_NAP
-#define HAVE_NAP 0
-#endif
-
#if HAVE_SELECT
#if HAVE_SYS_TIME_H
#include <sys/time.h>
@@ -81,6 +83,7 @@ usysdep_pause ()
/* We need to pass an unused pollfd structure because poll checks
the address before checking the number of elements. */
+ memset (&sdummy, 0, sizeof sdummy);
poll (&sdummy, 0, 500);
#endif /* HAVE_POLL */
#if HAVE_SELECT
OpenPOWER on IntegriCloud