]> granicus.if.org Git - procps-ng/commitdiff
c: print strerror() instead of error code.
authorÉrico Nogueira <erico.erc@gmail.com>
Fri, 4 Jun 2021 16:10:28 +0000 (13:10 -0300)
committerCraig Small <csmall@dropbear.xyz>
Wed, 16 Jun 2021 10:01:46 +0000 (20:01 +1000)
This changes error() behavior to match what glibc already does.

include/c.h

index aca88a72e1071dc45fe1d8eb8dc32957db0282fe..2471209c9316d594ccc5e13a47d0c9743e18653d 100644 (file)
@@ -118,7 +118,7 @@ static void error(int status, int errnum, const char *format, ...)
         vfprintf(stderr, format, argp);
         va_end(argp);
         if (errnum != 0)
-                fprintf(stderr, ": error code %d", errnum);
+                fprintf(stderr, ": %s", strerror(errnum));
         fprintf(stderr, "\n");
         if (status != 0)
                 exit(status);