[hackers] [ubase] mount: remove stat, not needed since we use realpath || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Sat, 07 Jun 2014 20:16:54 +0200

commit 1abf7518ada8a2b977cac0b97bd47da2aeb2f2d2
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sat Jun 7 19:35:35 2014 +0200

    mount: remove stat, not needed since we use realpath

diff --git a/mount.c b/mount.c
index 071d59f..8e870d8 100644
--- a/mount.c
+++ b/mount.c
_AT_@ -126,7 +126,6 @@ main(int argc, char *argv[])
         char *files[] = { "/proc/mounts", "/etc/fstab", NULL };
         size_t datasiz = sizeof(data);
         const char *source, *target;
- struct stat st;
         struct mntent *me = NULL;
         FILE *fp;
 
_AT_@ -176,8 +175,6 @@ main(int argc, char *argv[])
         if(!target) {
                 target = argv[0];
                 source = NULL;
- if(stat(target, &st) < 0)
- eprintf("stat %s:", target);
                 if(!(resolvpath = realpath(target, NULL)))
                         eprintf("realpath %s:", target);
                 target = resolvpath;
Received on Sat Jun 07 2014 - 20:16:54 CEST

This archive was generated by hypermail 2.3.0 : Sat Jun 07 2014 - 20:24:09 CEST