* Changes: Made this a standalone busybox module which uses standalone
* syslog() client interface.
*
- * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
- * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
+ * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org>
*
* Copyright (C) 2000 by Karl M. Hegbloom <karlheg@debian.org>
*
#include <unistd.h>
#include <ctype.h>
#include <sys/syslog.h>
-
-#if __GNU_LIBRARY__ < 5
-# ifdef __alpha__
-# define klogctl syslog
-# endif
-#else
-# include <sys/klog.h>
-#endif
+#include <sys/klog.h>
#include "busybox.h"
switch (opt) {
case 'c':
if ((optarg == NULL) || (optarg[1] != '\0')) {
- show_usage();
+ bb_show_usage();
}
/* Valid levels are between 1 and 8 */
console_log_level = *optarg - '1';
if (console_log_level > 7) {
- show_usage();
+ bb_show_usage();
}
console_log_level++;
doFork = FALSE;
break;
default:
- show_usage();
+ bb_show_usage();
}
}
if (doFork) {
-#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
if (daemon(0, 1) < 0)
- perror_msg_and_die("daemon");
-#else
- error_msg_and_die("daemon not supported");
+ bb_perror_msg_and_die("daemon");
+#if defined(__uClinux__)
+ vfork_daemon_rexec(argc, argv, "-n");
#endif
}
doKlogd(console_log_level);