[hackers] [sbase] readlink: Use eprintf() to report errors || sin

From: <git_AT_suckless.org>
Date: Wed, 11 Feb 2015 12:58:36 +0100 (CET)

commit d206067afc87ad34798bb8359db9d125d23b8bb0
Author: sin <sin_AT_2f30.org>
Date: Wed Feb 11 11:58:02 2015 +0000

    readlink: Use eprintf() to report errors

diff --git a/readlink.c b/readlink.c
index 444e034..682fdc2 100644
--- a/readlink.c
+++ b/readlink.c
_AT_@ -83,14 +83,14 @@ mdone:
                         break;
                 case 'e':
                         if (stat(argv[0], &st) < 0)
- exit(1);
+ eprintf("stat %s:", argv[0]);
                 case 'f':
                         if (!realpath(argv[0], b))
- exit(1);
+ eprintf("realpath %s:", argv[0]);
                         break;
                 default:
                         if ((n = readlink(argv[0], b, PATH_MAX - 1)) < 0)
- exit(1);
+ eprintf("readlink %s:", argv[0]);
                         b[n] = '\0';
         }
         printf("%s", b);
Received on Wed Feb 11 2015 - 12:58:36 CET

This archive was generated by hypermail 2.3.0 : Wed Feb 11 2015 - 13:00:21 CET