From 7892e9b63584b3bc9965e1d4e7d0188ba6fab8c5 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 28 Jul 2008 20:50:57 +0200 Subject: update licenses/file headers --- libdaemon/dsignal.c | 57 ++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 29 deletions(-) (limited to 'libdaemon/dsignal.c') diff --git a/libdaemon/dsignal.c b/libdaemon/dsignal.c index 781aa00..a759464 100644 --- a/libdaemon/dsignal.c +++ b/libdaemon/dsignal.c @@ -1,23 +1,22 @@ -/* $Id$ */ - -/* - * This file is part of libdaemon. - * - * libdaemon is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * libdaemon is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with libdaemon; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA - */ +/*** + This file is part of libdaemon. + + Copyright 2003-2008 Lennart Poettering + + libdaemon is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 2.1 of the + License, or (at your option) any later version. + + libdaemon is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with libdaemon. If not, see + . +***/ #ifdef HAVE_CONFIG_H #include @@ -63,7 +62,7 @@ int daemon_signal_install(int s){ if (_init() < 0) return -1; - + if (sigemptyset(&ss) < 0) { daemon_log(LOG_ERR, "sigemptyset(): %s", strerror(errno)); return -1; @@ -83,7 +82,7 @@ int daemon_signal_install(int s){ sa.sa_handler = _sigfunc; sigemptyset(&sa.sa_mask); sa.sa_flags = SA_RESTART; - + if (sigaction(s, &sa, NULL) < 0) { daemon_log(LOG_ERR, "sigaction(%s, ...) failed: %s", strsignal(s), strerror(errno)); return -1; @@ -94,7 +93,7 @@ int daemon_signal_install(int s){ int daemon_signal_init(int s, ...) { int sig, r = 0; - + va_list ap; va_start(ap, s); @@ -107,19 +106,19 @@ int daemon_signal_init(int s, ...) { r = -1; break; } - + sig = va_arg(ap, int); } - + va_end(ap); - + return r; } void daemon_signal_done(void) { if (_signal_pipe[0] != -1) close(_signal_pipe[0]); - + if (_signal_pipe[1] != -1) close(_signal_pipe[1]); @@ -132,7 +131,7 @@ int daemon_signal_next(void) { if ((r = read(_signal_pipe[0], &s, sizeof(s))) == sizeof(s)) return s; - + if (r < 0) { if (errno == EAGAIN) @@ -142,7 +141,7 @@ int daemon_signal_next(void) { return -1; } } - + daemon_log(LOG_ERR, "Short read() on signal pipe."); return -1; } -- cgit