summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-07-28 20:50:57 +0200
committerLennart Poettering <lennart@poettering.net>2008-07-28 20:50:57 +0200
commit7892e9b63584b3bc9965e1d4e7d0188ba6fab8c5 (patch)
treef7ad3f144958609f92973fc3cd4ce812cae1a50f
parentfbfaf950e6299952f9d2add5bb69c617f0bd91a9 (diff)
update licenses/file headers
-rw-r--r--Makefile.am13
-rwxr-xr-xbootstrap.sh12
-rw-r--r--configure.ac13
-rw-r--r--doc/Makefile.am13
-rw-r--r--doc/README.html.in20
-rw-r--r--doc/style.css37
-rw-r--r--examples/Makefile.am13
-rw-r--r--examples/testd.c39
-rw-r--r--libdaemon/Makefile.am13
-rw-r--r--libdaemon/daemon.h37
-rw-r--r--libdaemon/dexec.c85
-rw-r--r--libdaemon/dexec.h43
-rw-r--r--libdaemon/dfork.c39
-rw-r--r--libdaemon/dfork.h37
-rw-r--r--libdaemon/dlog.c45
-rw-r--r--libdaemon/dlog.h37
-rw-r--r--libdaemon/dnonblock.c39
-rw-r--r--libdaemon/dnonblock.h37
-rw-r--r--libdaemon/dpid.c39
-rw-r--r--libdaemon/dpid.h37
-rw-r--r--libdaemon/dsignal.c57
-rw-r--r--libdaemon/dsignal.h37
22 files changed, 359 insertions, 383 deletions
diff --git a/Makefile.am b/Makefile.am
index e988050..742b744 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,21 +1,20 @@
-# $Id$
-
# 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
+# 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
+# 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
+# License along with libdaemon. If not, see
+# <http://www.gnu.org/licenses/>.
EXTRA_DIST=bootstrap.sh LICENSE
SUBDIRS=libdaemon doc examples
diff --git a/bootstrap.sh b/bootstrap.sh
index 3b30052..2c872e1 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -1,22 +1,22 @@
#!/bin/sh
-# $Id$
# 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
+# 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
+# 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
+# License along with libdaemon. If not, see
+# <http://www.gnu.org/licenses/>.
VERSION=1.9
diff --git a/configure.ac b/configure.ac
index 07b6cd2..3875cd3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,24 +1,23 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
-# $Id$
-
# 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
+# 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
+# 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
+# License along with libdaemon. If not, see
+# <http://www.gnu.org/licenses/>.
AC_PREREQ(2.59)
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 44f69ec..7cbda71 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,21 +1,20 @@
-# $Id$
-
# 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
+# 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
+# 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
+# License along with libdaemon. If not, see
+# <http://www.gnu.org/licenses/>.
noinst_DATA = README.html
EXTRA_DIST = $(noinst_DATA) style.css README.html.in
diff --git a/doc/README.html.in b/doc/README.html.in
index db39390..4c784b4 100644
--- a/doc/README.html.in
+++ b/doc/README.html.in
@@ -26,20 +26,16 @@
<h2><a name="license">License</a></h2>
-<p>This library 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.</p>
-
-<p>This library 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
+<p>This program 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.</p>
+
+<p>This program 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.</p>
-<p>You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA</p>
-
<h2><a name="news">News</a></h2>
<div class="news-date">Tue Jul 10 2007: </div>
diff --git a/doc/style.css b/doc/style.css
index 2b24a1e..4d5a95a 100644
--- a/doc/style.css
+++ b/doc/style.css
@@ -1,23 +1,22 @@
-/* $Id$ */
+/***
+ This file is part of libdaemon.
-/*
- * 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
- */
+ 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
+ <http://www.gnu.org/licenses/>.
+***/
body { color: black; background-color: white; }
a:link, a:visited { color: #900000; }
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 02d70a6..2e4effa 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -1,21 +1,20 @@
-# $Id$
-#
# 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
+# 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
+# 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
+# License along with libdaemon. If not, see
+# <http://www.gnu.org/licenses/>.
noinst_PROGRAMS = testd
diff --git a/examples/testd.c b/examples/testd.c
index 3400af7..f9140cc 100644
--- a/examples/testd.c
+++ b/examples/testd.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
+ <http://www.gnu.org/licenses/>.
+***/
#include <signal.h>
#include <errno.h>
diff --git a/libdaemon/Makefile.am b/libdaemon/Makefile.am
index 6812c3d..11a5305 100644
--- a/libdaemon/Makefile.am
+++ b/libdaemon/Makefile.am
@@ -1,21 +1,20 @@
-# $Id$
-#
# 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
+# 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
+# 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
+# License along with libdaemon. If not, see
+# <http://www.gnu.org/licenses/>.
AM_CPPFLAGS='-DLOCALSTATEDIR="$(localstatedir)"'
diff --git a/libdaemon/daemon.h b/libdaemon/daemon.h
index 9c66d34..18eb5bf 100644
--- a/libdaemon/daemon.h
+++ b/libdaemon/daemon.h
@@ -1,26 +1,25 @@
#ifndef foodaemonhfoo
#define foodaemonhfoo
-/* $Id: exec.h 4 2003-08-10 19:56:53Z lennart $ */
+/***
+ This file is part of libdaemon.
-/*
- * 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
- */
+ 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
+ <http://www.gnu.org/licenses/>.
+***/
/** \file
*
diff --git a/libdaemon/dexec.c b/libdaemon/dexec.c
index 0a21777..f0d8415 100644
--- a/libdaemon/dexec.c
+++ b/libdaemon/dexec.c
@@ -1,23 +1,22 @@
-/* $Id: exec.c 31 2003-11-05 22:04:26Z lennart $ */
-
-/*
- * 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
+ <http://www.gnu.org/licenses/>.
+***/
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -59,21 +58,21 @@ int daemon_execv(const char *dir, int *ret, const char *prog, va_list ap) {
daemon_log(LOG_ERR, "pipe() failed: %s", strerror(errno));
return -1;
}
-
+
if ((pid = fork()) < 0) {
daemon_log(LOG_ERR, "fork() failed: %s", strerror(errno));
return -1;
-
+
} else if (pid == 0) {
char *args[MAX_ARGS];
int i;
-
+
if (p[1] != 1)
dup2(p[1], 1);
if (p[1] != 2)
dup2(p[1], 2);
-
+
if (p[0] > 2)
close(p[0]);
@@ -87,28 +86,28 @@ int daemon_execv(const char *dir, int *ret, const char *prog, va_list ap) {
}
daemon_close_all(-1);
-
+
umask(0022); /* Set up a sane umask */
-
+
if (dir && chdir(dir) < 0) {
daemon_log(LOG_WARNING, "Failed to change to directory '%s'", dir);
chdir("/");
}
-
+
for (i = 0; i < MAX_ARGS-1; i++)
if (!(args[i] = va_arg(ap, char*)))
break;
args[i] = NULL;
-
+
execv(prog, args);
-
+
daemon_log(LOG_ERR, "execv(%s) failed: %s", prog, strerror(errno));
-
+
_exit(EXIT_FAILURE);
}
-
+
close(p[1]);
-
+
FD_ZERO(&fds);
FD_SET(p[0], &fds);
sigfd = daemon_signal_fd();
@@ -135,41 +134,41 @@ int daemon_execv(const char *dir, int *ret, const char *prog, va_list ap) {
break;
buf[n] = c;
-
+
if (c == '\n' || n >= sizeof(buf) - 2) {
if (c != '\n') n++;
buf[n] = 0;
- if (buf[0])
- daemon_log(LOG_INFO, "client: %s", buf);
-
+ if (buf[0])
+ daemon_log(LOG_INFO, "client: %s", buf);
+
n = 0;
} else
n++;
}
-
+
if (FD_ISSET(sigfd, &qfds)) {
int sig;
-
+
if ((sig = daemon_signal_next()) < 0) {
daemon_log(LOG_ERR, "daemon_signal_next(): %s", strerror(errno));
break;
}
-
+
if (sig != SIGCHLD) {
daemon_log(LOG_WARNING, "Killing child.");
kill(pid, SIGTERM);
}
}
}
-
+
if (n > 0) {
buf[n] = 0;
- daemon_log(LOG_WARNING, "client: %s", buf);
+ daemon_log(LOG_WARNING, "client: %s", buf);
}
close(p[0]);
-
+
for (;;) {
if (waitpid(pid, &r, 0) < 0) {
@@ -193,7 +192,7 @@ int daemon_execv(const char *dir, int *ret, const char *prog, va_list ap) {
int daemon_exec(const char *dir, int *ret, const char *prog, ...) {
va_list ap;
int r;
-
+
va_start(ap, prog);
r = daemon_execv(dir, ret, prog, ap);
va_end(ap);
diff --git a/libdaemon/dexec.h b/libdaemon/dexec.h
index ebfbee5..1f7f7e8 100644
--- a/libdaemon/dexec.h
+++ b/libdaemon/dexec.h
@@ -1,26 +1,25 @@
#ifndef foodexechfoo
#define foodexechfoo
-/* $Id: exec.h 4 2003-08-10 19:56:53Z lennart $ */
+/***
+ This file is part of libdaemon.
-/*
- * 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
- */
+ 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
+ <http://www.gnu.org/licenses/>.
+***/
#include <stdarg.h>
@@ -43,14 +42,14 @@ extern "C" {
#else
#define DAEMON_GCC_SENTINEL
#endif
-
+
/** Run the specified executable with the specified arguments in the
* specified directory and return the return value of the program in
* the specified pointer. The calling process is blocked until the
* child finishes and all child output (either STDOUT or STDIN) has
* been written to syslog. Running this function requires that
* daemon_signal() has been called with SIGCHLD as argument.
- *
+ *
* @param dir Working directory for the process.
* @param ret A pointer to an integer to write the return value of the program to.
* @param prog The path to the executable
@@ -64,7 +63,7 @@ int daemon_exec(const char *dir, int *ret, const char *prog, ...) DAEMON_GCC_SEN
/** The same as daemon_exec, but without variadic arguments */
int daemon_execv(const char *dir, int *ret, const char *prog, va_list ap);
-
+
#ifdef __cplusplus
}
#endif
diff --git a/libdaemon/dfork.c b/libdaemon/dfork.c
index 514a356..464af49 100644
--- a/libdaemon/dfork.c
+++ b/libdaemon/dfork.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
+ <http://www.gnu.org/licenses/>.
+***/
#ifdef HAVE_CONFIG_H
#include <config.h>
diff --git a/libdaemon/dfork.h b/libdaemon/dfork.h
index 7d9b62a..566844f 100644
--- a/libdaemon/dfork.h
+++ b/libdaemon/dfork.h
@@ -1,26 +1,25 @@
#ifndef foodaemonforkhfoo
#define foodaemonforkhfoo
-/* $Id$ */
+/***
+ This file is part of libdaemon.
-/*
- * 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
- */
+ 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
+ <http://www.gnu.org/licenses/>.
+***/
#include <sys/types.h>
diff --git a/libdaemon/dlog.c b/libdaemon/dlog.c
index f832147..a5c8e44 100644
--- a/libdaemon/dlog.c
+++ b/libdaemon/dlog.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
+ <http://www.gnu.org/licenses/>.
+***/
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -35,9 +34,9 @@ const char* daemon_log_ident = NULL;
void daemon_logv(int prio, const char* template, va_list arglist) {
int saved_errno;
-
+
saved_errno = errno;
-
+
if (daemon_log_use & DAEMON_LOG_SYSLOG) {
openlog(daemon_log_ident ? daemon_log_ident : "UNKNOWN", LOG_PID, LOG_DAEMON);
vsyslog(prio | LOG_DAEMON, template, arglist);
@@ -58,7 +57,7 @@ void daemon_logv(int prio, const char* template, va_list arglist) {
void daemon_log(int prio, const char* template, ...) {
va_list arglist;
-
+
va_start(arglist, template);
daemon_logv(prio, template, arglist);
va_end(arglist);
diff --git a/libdaemon/dlog.h b/libdaemon/dlog.h
index 09479be..814171f 100644
--- a/libdaemon/dlog.h
+++ b/libdaemon/dlog.h
@@ -1,26 +1,25 @@
#ifndef foodaemonloghfoo
#define foodaemonloghfoo
-/* $Id$ */
+/***
+ This file is part of libdaemon.
-/*
- * 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
- */
+ 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
+ <http://www.gnu.org/licenses/>.
+***/
#include <syslog.h>
#include <stdarg.h>
diff --git a/libdaemon/dnonblock.c b/libdaemon/dnonblock.c
index 79b743a..b93d875 100644
--- a/libdaemon/dnonblock.c
+++ b/libdaemon/dnonblock.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
+ <http://www.gnu.org/licenses/>.
+***/
#ifdef HAVE_CONFIG_H
#include <config.h>
diff --git a/libdaemon/dnonblock.h b/libdaemon/dnonblock.h
index 39dd30b..8c5b8fd 100644
--- a/libdaemon/dnonblock.h
+++ b/libdaemon/dnonblock.h
@@ -1,26 +1,25 @@
#ifndef foodaemonnonblockhfoo
#define foodaemonnonblockhfoo
-/* $Id$ */
+/***
+ This file is part of libdaemon.
-/*
- * 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
- */
+ 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
+ <http://www.gnu.org/licenses/>.
+***/
#ifdef __cplusplus
extern "C" {
diff --git a/libdaemon/dpid.c b/libdaemon/dpid.c
index 10b9b77..145cf50 100644
--- a/libdaemon/dpid.c
+++ b/libdaemon/dpid.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
+ <http://www.gnu.org/licenses/>.
+***/
#ifdef HAVE_CONFIG_H
#include <config.h>
diff --git a/libdaemon/dpid.h b/libdaemon/dpid.h
index 963fe4c..01d87f3 100644
--- a/libdaemon/dpid.h
+++ b/libdaemon/dpid.h
@@ -1,26 +1,25 @@
#ifndef foodaemonpidhfoo
#define foodaemonpidhfoo
-/* $Id$ */
+/***
+ This file is part of libdaemon.
-/*
- * 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
- */
+ 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
+ <http://www.gnu.org/licenses/>.
+***/
#include <sys/types.h>
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
+ <http://www.gnu.org/licenses/>.
+***/
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -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;
}
diff --git a/libdaemon/dsignal.h b/libdaemon/dsignal.h
index b73f19a..1719784 100644
--- a/libdaemon/dsignal.h
+++ b/libdaemon/dsignal.h
@@ -1,26 +1,25 @@
#ifndef foodaemonsignalhfoo
#define foodaemonsignalhfoo
-/* $Id$ */
+/***
+ This file is part of libdaemon.
-/*
- * 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
- */
+ 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
+ <http://www.gnu.org/licenses/>.
+***/
#ifdef __cplusplus
extern "C" {