aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-02-26 12:00:13 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2009-02-26 12:00:13 +0200
commit3c4b1e89c855d7ee2f9bae810ad75de946fa8edc (patch)
tree1a53233c4ec392fa65796a37ea3e4942796eb1f2
parent81640ab2b9ad954d4952aed43a70d7874da1c463 (diff)
downloadwydawca-3c4b1e89c855d7ee2f9bae810ad75de946fa8edc.tar.gz
wydawca-3c4b1e89c855d7ee2f9bae810ad75de946fa8edc.tar.bz2
Minor fixes
-rw-r--r--NEWS2
-rw-r--r--configure.ac2
-rw-r--r--src/pidfile.c3
-rw-r--r--src/wydawca.c14
4 files changed, 12 insertions, 9 deletions
diff --git a/NEWS b/NEWS
index 95b2433..7f62bfa 100644
--- a/NEWS
+++ b/NEWS
@@ -2,13 +2,13 @@ Wydawca NEWS -- history of user-visible changes. 2009-02-16
Copyright (C) 2007, 2008, 2009 Sergey Poznyakoff
See the end of file for copying conditions.
Please send Wydawca bug reports to <bug-wydawca@gnu.org.ua>.
-Version 1.9.90 (Git)
+Version 1.9.91 (Git)
Version 1.2, 2009-01-22
* Implicit signature archivation.
diff --git a/configure.ac b/configure.ac
index 737e2dc..604ccc4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,13 +12,13 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with wydawca. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ(2.59)
-AC_INIT([wydawca], 1.9.90, [bug-wydawca@gnu.org.ua])
+AC_INIT([wydawca], 1.9.91, [bug-wydawca@gnu.org.ua])
AC_CONFIG_SRCDIR([src/wydawca.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE
# Checks for programs.
diff --git a/src/pidfile.c b/src/pidfile.c
index afbcb87..4e178db 100644
--- a/src/pidfile.c
+++ b/src/pidfile.c
@@ -30,13 +30,13 @@ void
check_pidfile ()
{
FILE *fp = fopen (pidfile, "r+");
if (fp)
{
- unsigned long pid;
+ unsigned long pid = -1;
if (fscanf (fp, "%lu\n", &pid) != 1)
{
logmsg (LOG_ERR, _("malformed pidfile %s"), pidfile);
if (!force_startup)
exit (EX_UNAVAILABLE);
}
@@ -81,10 +81,9 @@ check_pidfile ()
pidfile, strerror (errno));
exit (EX_UNAVAILABLE);
}
}
fprintf (fp, "%lu\n", (unsigned long) getpid ());
fclose (fp);
- atexit (remove_pidfile);
}
diff --git a/src/wydawca.c b/src/wydawca.c
index f02ac99..d210717 100644
--- a/src/wydawca.c
+++ b/src/wydawca.c
@@ -272,21 +272,25 @@ collect_uids (int argc, char **argv)
char **x_argv;
extern int reconfigure;
void
wydawca_daemon ()
{
- check_pidfile ();
-
- if (!foreground && daemon (0, 0))
+ if (!foreground)
{
- logmsg (LOG_ERR, "%s", strerror (errno));
- exit (EX_OSERR);
+ if (daemon (0, 0))
+ {
+ logmsg (LOG_ERR, "%s", strerror (errno));
+ exit (EX_OSERR);
+ }
+ logmsg (LOG_NOTICE, _("daemon launched"));
}
+ check_pidfile ();
wydawca_listener ();
+ remove_pidfile ();
}
#include "cmdline.h"
int

Return to:

Send suggestions and report system problems to the System administrator.