Commit 8680e536 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(set_handler_sig_ign): New function.

(server_init): Use it.
(go_daemon): Use it.  This reduces the number of warnings on some platforms.
parent 00f6ba30
/*
* $Id: ramkomd.c,v 0.110 2002/10/31 09:31:19 ceder Exp $
* $Id: ramkomd.c,v 0.111 2002/11/04 10:03:28 ceder Exp $
* Copyright (C) 1991-1999, 2001-2002 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -141,6 +141,23 @@ static IscSession *listen_client = NULL; /* ISC listen identifier */
static void dump_exit_statistics(void);
static void free_kom_info(void);
#ifdef HAVE_STRUCT_SIGACTION
/* Assigning SIG_IGN to sa_handler results in
ramkomd.c:310: warning: function declaration isn't a prototype
on certain compilers. By performing the assignment in a function
the number of warnings are reduced. */
static inline void
set_handler_sig_ign(struct sigaction *ptr)
{
ptr->sa_handler = SIG_IGN;
}
#endif
static void
server_init(const char *host, const char * client_port)
{
......@@ -191,7 +208,7 @@ server_init(const char *host, const char * client_port)
#ifdef HAVE_STRUCT_SIGACTION
sigemptyset(&act.sa_mask);
act.sa_flags = 0;
act.sa_handler = SIG_IGN;
set_handler_sig_ign(&act);
sigaction(SIGPIPE, &act, NULL);
#else
signal(SIGPIPE, SIG_IGN);
......@@ -307,7 +324,7 @@ go_daemon(void)
#ifdef HAVE_STRUCT_SIGACTION
sigemptyset(&act.sa_mask);
act.sa_flags = 0;
act.sa_handler = SIG_IGN;
set_handler_sig_ign(&act);
# ifdef SIGTTOU
sigaction(SIGTTOU, &act, NULL);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment