projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use logging.h instead of syslog.h
[tinc]
/
src
/
tincd.c
diff --git
a/src/tincd.c
b/src/tincd.c
index
c02ce5c
..
4e766a8
100644
(file)
--- a/
src/tincd.c
+++ b/
src/tincd.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: tincd.c,v 1.1
2 2002/04/09 15:26:01
zarq Exp $
+ $Id: tincd.c,v 1.1
4 2002/04/13 11:07:12
zarq Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-28,7
+28,6
@@
#include <signal.h>
#include <stdio.h>
#include <sys/types.h>
#include <signal.h>
#include <stdio.h>
#include <sys/types.h>
-#include <syslog.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>
@@
-52,6
+51,7
@@
#include "process.h"
#include "protocol.h"
#include "subnet.h"
#include "process.h"
#include "protocol.h"
#include "subnet.h"
+#include "logging.h"
#include "system.h"
#include "system.h"
@@
-296,7
+296,7
@@
void make_names(void)
if(!confbase)
asprintf(&confbase, "%s/tinc/%s", CONFDIR, netname);
else
if(!confbase)
asprintf(&confbase, "%s/tinc/%s", CONFDIR, netname);
else
-
syslog(
LOG_INFO, _("Both netname and configuration directory given, using the latter..."));
+
log(0, T
LOG_INFO, _("Both netname and configuration directory given, using the latter..."));
if(!identname)
asprintf(&identname, "tinc.%s", netname);
}
if(!identname)
asprintf(&identname, "tinc.%s", netname);
}
@@
-338,11
+338,7
@@
main(int argc, char **argv, char **envp)
if(show_help)
usage(0);
if(show_help)
usage(0);
-#ifdef HAVE_SOLARIS
- openlog("tinc", LOG_CONS, LOG_DAEMON); /* Catch all syslog() calls issued before detaching */
-#else
- openlog("tinc", LOG_PERROR, LOG_DAEMON); /* Catch all syslog() calls issued before detaching */
-#endif
+ log_add_hook(log_default);
g_argv = argv;
g_argv = argv;
@@
-383,17
+379,17
@@
cp
cleanup_and_exit(1);
}
cleanup_and_exit(1);
}
-
syslog(LOG_ER
R, _("Unrecoverable error"));
+
log(0, TLOG_ERRO
R, _("Unrecoverable error"));
cp_trace();
if(do_detach)
{
cp_trace();
if(do_detach)
{
-
syslog(
LOG_NOTICE, _("Restarting in %d seconds!"), maxtimeout);
+
log(0, T
LOG_NOTICE, _("Restarting in %d seconds!"), maxtimeout);
sleep(maxtimeout);
}
else
{
sleep(maxtimeout);
}
else
{
-
syslog(LOG_ER
R, _("Not restarting."));
+
log(0, TLOG_ERRO
R, _("Not restarting."));
exit(1);
}
}
exit(1);
}
}