Signed-off-by: W. Trevor King <wking@tremily.us>
# Checks for header files.
-AC_CHECK_HEADERS_ONCE([locale.h sys/select.h sys/uio.h argp.h
+AC_CHECK_HEADERS_ONCE([locale.h signal.h sys/select.h sys/uio.h argp.h
unistd.h sys/time.h sys/types.h sys/stat.h])
#include <getopt.h>
#include <ctype.h>
#include <stdarg.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <wordexp.h>
-#include <unistd.h>
+#ifndef HAVE_W32_SYSTEM
+# include <sys/types.h>
+# include <sys/socket.h>
+# include <sys/un.h>
+# include <wordexp.h>
+#endif /*!HAVE_W32_SYSTEM*/
+#ifdef HAVE_SIGNAL_H
+# include <signal.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif
exit (EXIT_FAILURE);
}
+#ifdef HAVE_SIGNAL_H
signal (SIGINT, &cleanup_handler);
signal (SIGTERM, &cleanup_handler);
+#endif
listen (socket_fd, 5);
/* parent; continue listening for other connections */
}
+#ifdef HAVE_SIGNAL_H
/* the child doesn't need cleanup handlers */
signal (SIGINT, SIG_DFL);
signal (SIGTERM, SIG_DFL);
+#endif
err = assuan_init_socket_server (
server.assuan_ctx, sock,