summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install/lib
diff options
context:
space:
mode:
authorasami <asami@FreeBSD.org>1995-06-24 10:12:59 +0000
committerasami <asami@FreeBSD.org>1995-06-24 10:12:59 +0000
commit9708dec633d601cd35249c0dc0de52a81459d564 (patch)
tree7df8f25f1a8b408effa29bb209626fab8ac797f0 /usr.sbin/pkg_install/lib
parent62d154d2101fad2261de96cdebd839b26736113c (diff)
downloadFreeBSD-src-9708dec633d601cd35249c0dc0de52a81459d564.zip
FreeBSD-src-9708dec633d601cd35249c0dc0de52a81459d564.tar.gz
Use lstat() instead of access() for checking file existence. It works
for symlinks too, and according to Rod, access() is evil anyway. Reviewed by: jkh
Diffstat (limited to 'usr.sbin/pkg_install/lib')
-rw-r--r--usr.sbin/pkg_install/lib/file.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/pkg_install/lib/file.c b/usr.sbin/pkg_install/lib/file.c
index 29d969c..1d578d6 100644
--- a/usr.sbin/pkg_install/lib/file.c
+++ b/usr.sbin/pkg_install/lib/file.c
@@ -1,5 +1,5 @@
#ifndef lint
-static const char *rcsid = "$Id: file.c,v 1.9 1995/05/10 23:00:16 jkh Exp $";
+static const char *rcsid = "$Id: file.c,v 1.10 1995/05/30 03:50:05 rgrimes Exp $";
#endif
/*
@@ -30,7 +30,8 @@ static const char *rcsid = "$Id: file.c,v 1.9 1995/05/10 23:00:16 jkh Exp $";
Boolean
fexists(char *fname)
{
- if (!access(fname, F_OK))
+ struct stat dummy;
+ if (!lstat(fname, &dummy))
return TRUE;
return FALSE;
}
OpenPOWER on IntegriCloud