X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fshared%2Futil.c;h=3d16cd1a13a5c52d4a30d955a5235adcefe8c3c7;hp=e2c955bc0700594620a7c517d2a368c7593f296e;hb=58d617429dcfb6fb1ea0f7b6cbce82266ccbb1aa;hpb=5cb36f41f01cf4b1f4395abfffd1b33116591e58 diff --git a/src/shared/util.c b/src/shared/util.c index e2c955bc0..3d16cd1a1 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -1083,7 +1083,7 @@ int unhexchar(char c) { if (c >= 'A' && c <= 'F') return c - 'A' + 10; - return -1; + return -EINVAL; } char *hexmem(const void *p, size_t l) { @@ -1138,7 +1138,7 @@ int unoctchar(char c) { if (c >= '0' && c <= '7') return c - '0'; - return -1; + return -EINVAL; } char decchar(int x) { @@ -1150,7 +1150,7 @@ int undecchar(char c) { if (c >= '0' && c <= '9') return c - '0'; - return -1; + return -EINVAL; } char *cescape(const char *s) { @@ -1422,6 +1422,7 @@ _pure_ static bool ignore_file_allow_backup(const char *filename) { endswith(filename, ".rpmorig") || endswith(filename, ".dpkg-old") || endswith(filename, ".dpkg-new") || + endswith(filename, ".dpkg-tmp") || endswith(filename, ".swp"); } @@ -3055,7 +3056,7 @@ int status_vprintf(const char *status, bool ellipse, bool ephemeral, const char if (emax < 3) emax = 3; - e = ellipsize(s, emax, 75); + e = ellipsize(s, emax, 50); if (e) { free(s); s = e; @@ -4955,7 +4956,7 @@ int signal_from_string(const char *s) { if (signo > 0 && signo < _NSIG) return signo; } - return -1; + return -EINVAL; } bool kexec_loaded(void) {