chiark / gitweb /
Fix elogind debug mode:
authorSven Eden <yamakuzure@gmx.net>
Mon, 18 Jun 2018 15:33:08 +0000 (17:33 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 29 Jun 2018 05:12:51 +0000 (07:12 +0200)
When switched from autotools to meson, config.h changed fundamentally.

Although enabled values are still
  #define HAVE_FOO 1
the disabled values are nolonger undef, but now
  #define HAVE_FOO 0

Therefore all instances of
  #ifdef ENABLE_DEBUG_ELOGIND
have been changed to
  #if ENABLE_DEBUG_ELOGIND

src/basic/log.h
src/login/eloginctl.c
src/login/elogind.c
src/login/logind.c

index 3a3c43edc94878fecb9bdb8f2b3498c3d222372f..8094a85560cef3ee7bec1c3206d18dab57438bbd 100644 (file)
@@ -257,7 +257,7 @@ int log_emergency_level(void);
 #  define log_trace(...) do {} while (0)
 #endif
 
-#ifdef ENABLE_DEBUG_ELOGIND
+#if ENABLE_DEBUG_ELOGIND
 #  define log_debug_elogind(...) log_debug(__VA_ARGS__);usleep(25*USEC_PER_MSEC)
 #else
 #  define log_debug_elogind(...) do {} while (0)
index 2b2bcde3cd3e73c88a119da9f2feaa1172cfc001..111c770b5c9719751cfea881b22729b35bca1529 100644 (file)
@@ -218,7 +218,7 @@ void elogind_cleanup(void) {
 
 /* Little debug log helper, helps debugging systemctl comands we mimic. */
 static void elogind_log_special(enum elogind_action a) {
-#ifdef ENABLE_DEBUG_ELOGIND
+#if ENABLE_DEBUG_ELOGIND
         switch (a) {
         case ACTION_HALT:
                 log_struct(LOG_INFO,
index 2fae0f193a9ae239502d0840108cdf7ef67832b4..90ae3d7f11b9ecd5018fdf87dc8c86981fc13778 100644 (file)
@@ -97,7 +97,7 @@ static int elogind_daemonize(void) {
         pid_t SID;
         int r;
 
-#ifdef ENABLE_DEBUG_ELOGIND
+#if ENABLE_DEBUG_ELOGIND
         log_notice("Double forking elogind");
         log_notice("Parent PID     : %5d", getpid_cached());
         log_notice("Parent SID     : %5d", getsid(getpid_cached()));
@@ -115,7 +115,7 @@ static int elogind_daemonize(void) {
         if (r)
                 return child;
 
-#ifdef ENABLE_DEBUG_ELOGIND
+#if ENABLE_DEBUG_ELOGIND
         log_notice("Child PID      : %5d", getpid_cached());
         log_notice("Child SID      : %5d", getsid(getpid_cached()));
 #endif // ENABLE_DEBUG_ELOGIND
@@ -124,7 +124,7 @@ static int elogind_daemonize(void) {
         if ((pid_t)-1 == SID)
                 return log_error_errno(errno, "Failed to create new SID: %m");
 
-#ifdef ENABLE_DEBUG_ELOGIND
+#if ENABLE_DEBUG_ELOGIND
         log_notice("Child new SID  : %5d", getsid(getpid_cached()));
 #endif // ENABLE_DEBUG_ELOGIND
 
@@ -142,7 +142,7 @@ static int elogind_daemonize(void) {
 
         umask(0022);
 
-#ifdef ENABLE_DEBUG_ELOGIND
+#if ENABLE_DEBUG_ELOGIND
         log_notice("Grand child PID: %5d", getpid_cached());
         log_notice("Grand child SID: %5d", getsid(getpid_cached()));
 #endif // ENABLE_DEBUG_ELOGIND
@@ -319,7 +319,7 @@ int elogind_startup(int argc, char *argv[]) {
 
         /* Note: At this point, the logging is not initialized, so we can not
                  use log_debug_elogind(). */
-#ifdef ENABLE_DEBUG_ELOGIND
+#if ENABLE_DEBUG_ELOGIND
         log_notice("elogind startup: Daemonize: %s, Show Help: %s, Wrong arg: %s",
                 daemonize ? "True" : "False",
                 show_help ? "True" : "False",
@@ -404,7 +404,7 @@ int elogind_manager_new(Manager* m) {
 /// Add-On for manager_reset_config()
 void elogind_manager_reset_config(Manager* m) {
 
-#ifdef ENABLE_DEBUG_ELOGIND
+#if ENABLE_DEBUG_ELOGIND
         int dbg_cnt;
 #endif // ENABLE_DEBUG_ELOGIND
 
@@ -420,7 +420,7 @@ void elogind_manager_reset_config(Manager* m) {
         if (!m->hybrid_sleep_state)
                 m->hybrid_sleep_state = strv_new("disk", NULL);
 
-#ifdef ENABLE_DEBUG_ELOGIND
+#if ENABLE_DEBUG_ELOGIND
         dbg_cnt = -1;
         while (m->suspend_mode && m->suspend_mode[++dbg_cnt])
                 log_debug_elogind("suspend_mode[%d] = %s",
index ec407852a8c78b2927c3bcd59b4048a49fc10d19..1251eb0baae61de5fcc529e6fd989241720ab7f1 100644 (file)
@@ -1284,7 +1284,7 @@ int main(int argc, char *argv[]) {
         log_set_target(LOG_TARGET_AUTO);
         log_set_facility(LOG_AUTH);
         log_parse_environment();
-#ifdef ENABLE_DEBUG_ELOGIND
+#if ENABLE_DEBUG_ELOGIND
         log_set_max_level(LOG_DEBUG);
         log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
 #endif // ENABLE_DEBUG_ELOGIND