[systemd-commits] 3 commits - configure.ac src/log.c src/log.h src/main.c

Lennart Poettering lennart at kemper.freedesktop.org
Wed Jun 9 06:43:42 PDT 2010


 configure.ac |    2 +-
 src/log.c    |   11 +++++++++++
 src/log.h    |    1 +
 src/main.c   |   10 +++++-----
 4 files changed, 18 insertions(+), 6 deletions(-)

New commits:
commit 2f198e2f36a4acc05171cc2169bc58887c42d350
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Jun 9 15:38:46 2010 +0200

    main: rename systemd.default= to systemd.unit=

diff --git a/src/main.c b/src/main.c
index 7c93f6d..5360455 100644
--- a/src/main.c
+++ b/src/main.c
@@ -233,8 +233,8 @@ static int parse_proc_cmdline_word(const char *word) {
                 "5",      SPECIAL_RUNLEVEL5_TARGET
         };
 
-        if (startswith(word, "systemd.default="))
-                return set_default_unit(word + 16);
+        if (startswith(word, "systemd.unit="))
+                return set_default_unit(word + 13);
 
         else if (startswith(word, "systemd.log_target=")) {
 
@@ -343,7 +343,7 @@ static int parse_argv(int argc, char *argv[]) {
         enum {
                 ARG_LOG_LEVEL = 0x100,
                 ARG_LOG_TARGET,
-                ARG_DEFAULT,
+                ARG_UNIT,
                 ARG_RUNNING_AS,
                 ARG_TEST,
                 ARG_DUMP_CONFIGURATION_ITEMS,
@@ -355,7 +355,7 @@ static int parse_argv(int argc, char *argv[]) {
         static const struct option options[] = {
                 { "log-level",                required_argument, NULL, ARG_LOG_LEVEL                },
                 { "log-target",               required_argument, NULL, ARG_LOG_TARGET               },
-                { "default",                  required_argument, NULL, ARG_DEFAULT                  },
+                { "unit",                     required_argument, NULL, ARG_UNIT                     },
                 { "running-as",               required_argument, NULL, ARG_RUNNING_AS               },
                 { "test",                     no_argument,       NULL, ARG_TEST                     },
                 { "help",                     no_argument,       NULL, 'h'                          },
@@ -392,7 +392,7 @@ static int parse_argv(int argc, char *argv[]) {
 
                         break;
 
-                case ARG_DEFAULT:
+                case ARG_UNIT:
 
                         if ((r = set_default_unit(optarg)) < 0) {
                                 log_error("Failed to set default unit %s: %s", optarg, strerror(-r));
commit 9fae33d2c8fe968e99d882728c4d072419798716
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Jun 9 15:37:37 2010 +0200

    log: add null log target

diff --git a/src/log.c b/src/log.c
index bf2382d..94fb823 100644
--- a/src/log.c
+++ b/src/log.c
@@ -162,6 +162,12 @@ int log_open(void) {
          * the fs. If we don't use /dev/kmsg we still keep it open,
          * because there is no reason to close it. */
 
+        if (log_target == LOG_TARGET_NULL) {
+                log_close_syslog();
+                log_close_console();
+                return 0;
+        }
+
         if (log_target == LOG_TARGET_SYSLOG_OR_KMSG ||
             log_target == LOG_TARGET_SYSLOG)
                 if ((r = log_open_syslog()) >= 0) {
@@ -186,6 +192,7 @@ void log_set_target(LogTarget target) {
         assert(target < _LOG_TARGET_MAX);
 
         log_target = target;
+        log_open();
 }
 
 void log_set_max_level(int level) {
@@ -316,6 +323,9 @@ static int log_dispatch(
 
         int r = 0;
 
+        if (log_target == LOG_TARGET_NULL)
+                return 0;
+
         do {
                 char *e;
                 int k;
@@ -475,6 +485,7 @@ static const char *const log_target_table[] = {
         [LOG_TARGET_SYSLOG] = "syslog",
         [LOG_TARGET_KMSG] = "kmsg",
         [LOG_TARGET_SYSLOG_OR_KMSG] = "syslog-or-kmsg",
+        [LOG_TARGET_NULL] = "null"
 };
 
 DEFINE_STRING_TABLE_LOOKUP(log_target, LogTarget);
diff --git a/src/log.h b/src/log.h
index 9d141dc..1d9a100 100644
--- a/src/log.h
+++ b/src/log.h
@@ -33,6 +33,7 @@ typedef enum LogTarget{
         LOG_TARGET_KMSG,
         LOG_TARGET_SYSLOG,
         LOG_TARGET_SYSLOG_OR_KMSG,
+        LOG_TARGET_NULL,
         _LOG_TARGET_MAX,
         _LOG_TARGET_INVALID = -1
 }  LogTarget;
commit b60e6bbf67063c6b81b5025d572ebe71aa7ab799
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Jun 9 15:37:05 2010 +0200

    build-sys: enable bz2 tarballs

diff --git a/configure.ac b/configure.ac
index 7ad3e2b..02618ae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@ AC_CONFIG_SRCDIR([src/main.c])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_HEADERS([config.h])
 
-AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax subdir-objects])
+AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax subdir-objects dist-bzip2])
 
 AC_SUBST(PACKAGE_URL, [http://www.freedesktop.org/wiki/Software/systemd])
 


More information about the systemd-commits mailing list