X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Futil.c;h=7903ca07b99fe64d493948f579eb9e34f3adbd31;hb=d06dacd0020af7e31ff6089deff339b00ed979e3;hp=3bcce2f019bcf6af535d5f4942d135185da4a870;hpb=618e02c7b7f8e11fdb954a019342d745937baf55;p=elogind.git diff --git a/src/util.c b/src/util.c index 3bcce2f01..7903ca07b 100644 --- a/src/util.c +++ b/src/util.c @@ -57,6 +57,7 @@ #include "log.h" #include "strv.h" #include "label.h" +#include "exit-status.h" bool streq_ptr(const char *a, const char *b) { @@ -2398,6 +2399,16 @@ bool is_clean_exit(int code, int status) { return false; } +bool is_clean_exit_lsb(int code, int status) { + + if (is_clean_exit(code, status)) + return true; + + return + code == CLD_EXITED && + (status == EXIT_NOTINSTALLED || status == EXIT_NOTCONFIGURED); +} + bool is_device_path(const char *path) { /* Returns true on paths that refer to a device, either in @@ -2981,23 +2992,6 @@ char *ellipsize(const char *s, unsigned length, unsigned percent) { return r; } -void nss_disable_nscd(void) { - - void (*func)(void); - - /* This is an internal glibc function call. We are not - * supposed to call this, because we are not nscd. However - * sometimes we feel really dangerous and do it - * nonetheless. Muahahah! But at least we protect this with a - * dlsym() just in case glibc takes this away from us. */ - - if ((func = dlsym(RTLD_DEFAULT, "__nss_disable_nscd"))) { - log_debug("Disabling nscd."); - func(); - } else - log_debug("Cannot disable nscd."); -} - int touch(const char *path) { int fd;