X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;ds=sidebyside;f=src%2Futil.c;h=7692a2d620cbe5464ddfe1c74d23796e154fc707;hb=a338bab5d0603a179befce062bc6fc8a6521a232;hp=67a75c5702fa9f0490df241ad5eefb5e9b26f966;hpb=86a3475bc5087da2a28015247ff18672905044f4;p=elogind.git diff --git a/src/util.c b/src/util.c index 67a75c570..7692a2d62 100644 --- a/src/util.c +++ b/src/util.c @@ -250,7 +250,7 @@ int parse_boolean(const char *v) { } int parse_pid(const char *s, pid_t* ret_pid) { - unsigned long ul; + unsigned long ul = 0; pid_t pid; int r; @@ -2617,33 +2617,6 @@ int make_null_stdio(void) { return make_stdio(null_fd); } -bool is_clean_exit(int code, int status) { - - if (code == CLD_EXITED) - return status == 0; - - /* If a daemon does not implement handlers for some of the - * signals that's not considered an unclean shutdown */ - if (code == CLD_KILLED) - return - status == SIGHUP || - status == SIGINT || - status == SIGTERM || - status == SIGPIPE; - - 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 @@ -3044,6 +3017,21 @@ void status_welcome(void) { if (!ansi_color) const_color = "1;34"; /* Light Blue for Gentoo */ +#elif defined(TARGET_ALTLINUX) + + if (!pretty_name) { + if ((r = read_one_line_file("/etc/altlinux-release", &pretty_name)) < 0) { + + if (r != -ENOENT) + log_warning("Failed to read /etc/altlinux-release: %s", strerror(-r)); + } else + truncate_nl(pretty_name); + } + + if (!ansi_color) + const_color = "0;36"; /* Cyan for ALTLinux */ + + #elif defined(TARGET_DEBIAN) if (!pretty_name) { @@ -3531,7 +3519,7 @@ char *fstab_node_to_udev_node(const char *p) { if (!t) return NULL; - r = asprintf(&dn, "/dev/disk/by-uuid/%s", ascii_strlower(t)); + r = asprintf(&dn, "/dev/disk/by-uuid/%s", t); free(t); if (r < 0)