summaryrefslogtreecommitdiff
path: root/cleopatre
diff options
context:
space:
mode:
authorThierry Carré2013-03-18 17:16:58 +0100
committerThierry Carré2013-04-26 17:03:09 +0200
commit5f1dad9e3acb962a2ebef8370726f822b5f9b4a0 (patch)
treec481dfd133f43cb6882b0c5b99e856b190250455 /cleopatre
parenta61c2b5a3bb1bb0a0872f812c42dea3987dead86 (diff)
cleo/devkit/plcd: add missing close, refs #3866
Where we have an open, we have the close.
Diffstat (limited to 'cleopatre')
-rw-r--r--cleopatre/devkit/plcd/src/plcd_main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/cleopatre/devkit/plcd/src/plcd_main.c b/cleopatre/devkit/plcd/src/plcd_main.c
index d0bc0d0f8c..6c448affa2 100644
--- a/cleopatre/devkit/plcd/src/plcd_main.c
+++ b/cleopatre/devkit/plcd/src/plcd_main.c
@@ -249,6 +249,9 @@ main (int argc, char **argv)
static plcd_ctx_t plcd_ctx;
int c = 0, opt_index = 0, init_nb = 0, init_ret = -1;
+ /* Open log process. */
+ openlog (argv[0], 0, LOG_DAEMON);
+
plcd_main_init (&plcd_ctx);
/* input program arguments */
@@ -265,9 +268,6 @@ main (int argc, char **argv)
/* show PLCD version */
syslog (LOG_NOTICE, "PLC Daemon (%s) Running\n", VERSION);
- /* open log process */
- openlog (argv[0], 0, LOG_DAEMON);
-
/* process options */
while (-1 != (c = getopt_long_only (argc, argv, "c:i:v:", long_opts,
@@ -347,5 +347,6 @@ main (int argc, char **argv)
libspid_system_file_update_unregister (pid, LIBSPID_HPAV_INFO_PATH);
libspid_system_file_update_unregister (pid, LIBSPID_MULTICAST_INFO_PATH);
plcd_main_uninit (&plcd_ctx);
+ closelog ();
exit (EXIT_SUCCESS);
}