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

From: <git_AT_suckless.org>
Date: Tue, 24 Mar 2015 23:53:42 +0100 (CET)

commit 6d4a7989cda6a60fddced9e916fa2882e095afa9
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 Tue Mar 24 2015 - 23:53:42 CET

This archive was generated by hypermail 2.3.0 : Wed Mar 25 2015 - 00:09:04 CET