Skip to content
Browse files

Make sure _GNU_SOURCE is defined so that checks for EINTR are not nec…

…essary.

Got rid of superfluous checks.
  • Loading branch information...
1 parent acb7731 commit 8ddfd2d003affcfec7f1786c5a5edc1345301ac1 @mschuerig committed Feb 1, 2009
Showing with 14 additions and 13 deletions.
  1. +13 −9 configure.ac
  2. +1 −4 src/hangon.c
View
22 configure.ac
@@ -13,14 +13,15 @@ AC_ARG_ENABLE([debug],
AM_CONDITIONAL([DEBUG], [test x$enable_debug = xtrue])
# Checks for programs.
+AC_GNU_SOURCE
AC_PROG_CC
-## gnulib needs to be initialized before any further checks.
+# gnulib needs to be initialized before any further checks.
+# see below for gl_INIT
gl_EARLY
-gl_INIT
-## Checks for libraries.
-## would go here
+# Checks for libraries.
+# would go here
# Checks for header files.
AC_HEADER_STDC
@@ -37,17 +38,20 @@ AC_TYPE_SSIZE_T
AC_FUNC_FORK
AC_CHECK_FUNCS([atexit dup2 setlocale])
+# Setup gnulib
+gl_INIT
+
# Checks for gettext.
-## Use a libintl installed on the system.
+# Use a libintl installed on the system.
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.17])
# Testing
AC_CONFIG_TESTDIR([tests], [tests:src])
-## Define additional programs needed for hacking on this project,
-## but not required for simply building it.
-## autom4te: used for merging tests into a suite
+# Define additional programs needed for hacking on this project,
+# but not required for simply building it.
+# autom4te: used for merging tests into a suite
AM_MISSING_PROG([AUTOM4TE], [autom4te])
if test "x$cross_compiling" = "xno"; then
@@ -57,6 +61,6 @@ else
HELP2MAN=:
fi
-## Generate Output
+dnl Generate Output
AC_CONFIG_FILES([Makefile gnulib/lib/Makefile src/Makefile doc/Makefile po/Makefile.in tests/Makefile])
AC_OUTPUT
View
5 src/hangon.c
@@ -199,7 +199,7 @@ pass_stdout(int fd)
bytes_read = read(fd, buffer, sizeof(buffer));
debug("READ (%d): %.*s\n", bytes_read, bytes_read, buffer);
if (bytes_read < 0) {
- status = (errno == EINTR) ? 0 : -1; /* @callout EINTR */
+ status = -1;
/* @endexcerpt read */
} else if (bytes_read == 0) {
status = COMMAND_DONE; /* @callout success */
@@ -229,9 +229,6 @@ watch_command_stdout(int fd)
status = pselect(fd + 1, &rfds, NULL, NULL, timeout, NULL);
switch (status) {
case -1:
- if (errno == EINTR) {
- status = 0;
- }
break;
case 0: /* timeout */
debug("TIMEOUT\n");

0 comments on commit 8ddfd2d

Please sign in to comment.
Something went wrong with that request. Please try again.