diff options
-rw-r--r-- | configure.ac | 16 | ||||
-rw-r--r-- | src/procdialogs.cpp | 6 | ||||
-rw-r--r-- | src/proctable.cpp | 5 | ||||
-rw-r--r-- | src/util.h | 3 |
4 files changed, 17 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac index 0edfd3b..411a977 100644 --- a/configure.ac +++ b/configure.ac @@ -34,6 +34,9 @@ GIOMM_REQUIRED=2.26.0 GLIBMM_REQUIRED=2.22 LIBXML_REQUIRED=2.0 RSVG_REQUIRED=2.35 +SYSTEMD_REQUIRED=38 +# systemd v43 used the C++ keyword 'class' as a function parameter. This breaks the build for C++ programs. +SYSTEMD_EXCLUDED=43 AC_MSG_CHECKING([which gtk+ version to compile against]) AC_ARG_WITH([gtk], @@ -65,11 +68,14 @@ PKG_CHECK_MODULES(GMODULE,gmodule-2.0,[GMODULE_ADD="gmodule-2.0"],[GMODULE_ADD=" PKG_CHECK_MODULES(PROCMAN,$GMODULE_ADD glib-2.0 >= $GLIB_REQUIRED libgtop-2.0 >= $LIBGTOP_REQUIRED libwnck-$LIBWNCK_API_VERSION >= $LIBWNCK_REQUIRED gtk+-$GTK_API_VERSION >= $GTK_REQUIRED mate-icon-theme >= $MATE_ICON_THEME_REQUIRED gtkmm-$GTKMM_API_VERSION >= $GTKMM_REQUIRED libxml-2.0 >= $LIBXML_REQUIRED librsvg-2.0 >= $RSVG_REQUIRED glibmm-2.4 >= $GLIBMM_REQUIRED giomm-2.4 >= $GIOMM_REQUIRED) have_systemd=no -AC_ARG_ENABLE(systemd, AS_HELP_STRING([--disable-systemd], [disable systemd support])) -if test "x$enable_systemd" != "xno"; then - PKG_CHECK_MODULES(SYSTEMD, [ libsystemd-daemon libsystemd-login ], - [AC_DEFINE(HAVE_SYSTEMD, 1, [Define if systemd is available]) have_systemd=yes], have_systemd=no) - if test "x$have_systemd" = xno -a "x$enable_systemd" = xyes; then +AC_ARG_ENABLE(systemd, AS_HELP_STRING([--disable-systemd], [disable systemd support]),,enable_systemd=no) + if test "x$enable_systemd" != "xno"; then + PKG_CHECK_MODULES(SYSTEMD, [ libsystemd-login >= $SYSTEMD_REQUIRED ], + [ PKG_CHECK_MODULES(SYSTEMD_EX, [ libsystemd-login = $SYSTEMD_EXCLUDED ], + AC_MSG_ERROR([*** systemd v43 found but it has a bug in its header files (uses C++ keyword)]), # Can't use systemd v43 + [AC_DEFINE(HAVE_SYSTEMD, 1, [Define if systemd is available]) have_systemd=yes])], + have_systemd=no) +if test "x$have_systemd" = xno; then AC_MSG_ERROR([*** systemd support requested but libraries not found]) fi fi diff --git a/src/procdialogs.cpp b/src/procdialogs.cpp index 7d7aace..95b2527 100644 --- a/src/procdialogs.cpp +++ b/src/procdialogs.cpp @@ -25,10 +25,6 @@ #include <signal.h> #include <string.h> -#ifdef HAVE_SYSTEMD -#include <systemd/sd-daemon.h> -#endif - #include "procdialogs.h" #include "proctable.h" #include "callbacks.h" @@ -479,7 +475,7 @@ create_field_page(GtkWidget *tree, const char* text) column_id == COL_SEAT || column_id == COL_OWNER) #ifdef HAVE_SYSTEMD - && sd_booted() <= 0 + && !LOGIND_RUNNING() #endif ) continue; diff --git a/src/proctable.cpp b/src/proctable.cpp index 25b1f36..20f0db5 100644 --- a/src/proctable.cpp +++ b/src/proctable.cpp @@ -45,7 +45,6 @@ #include <list> #ifdef HAVE_SYSTEMD -#include <systemd/sd-daemon.h> #include <systemd/sd-login.h> #endif @@ -488,7 +487,7 @@ proctable_new (ProcData * const procdata) } #ifdef HAVE_SYSTEMD - if (sd_booted() <= 0) + if (!LOGIND_RUNNING()) #endif { GtkTreeViewColumn *column; @@ -756,7 +755,7 @@ get_process_systemd_info(ProcInfo *info) #ifdef HAVE_SYSTEMD uid_t uid; - if (sd_booted() <= 0) + if (!LOGIND_RUNNING()) return; free(info->unit); @@ -28,6 +28,9 @@ inline int procman_cmp(T x, T y) #define PROCMAN_CMP(X, Y) procman_cmp((X), (Y)) #define PROCMAN_RCMP(X, Y) procman_cmp((Y), (X)); +/* check if logind is running */ +#define LOGIND_RUNNING() (access("/run/systemd/seats/", F_OK) >= 0) + GtkWidget* procman_make_label_for_mmaps_or_ofiles(const char *format, const char *process_name, |