summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTodd T. Fries <todd@cvs.openbsd.org>2007-02-07 23:47:57 +0000
committerTodd T. Fries <todd@cvs.openbsd.org>2007-02-07 23:47:57 +0000
commitb98d700131c88a765e2fe7d375f64fbd38a3c4e9 (patch)
tree019bc15bddabd70e8296fe1faa163b988d82b9dd /usr.bin
parentf938fa13a69e9c1ac522703ef176f590d16bc0ef (diff)
fstat() -> lstat() in a few select cases,
this fixes a bug where opencvs update would abort if a link existed that pointed to a non-existent file/dir ok joris@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cvs/file.c6
-rw-r--r--usr.bin/cvs/repository.c6
-rw-r--r--usr.bin/cvs/util.c4
3 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c
index 3868efb286d..130e28ff4c6 100644
--- a/usr.bin/cvs/file.c
+++ b/usr.bin/cvs/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.183 2007/01/31 21:07:35 xsa Exp $ */
+/* $OpenBSD: file.c,v 1.184 2007/02/07 23:47:56 todd Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
@@ -415,10 +415,10 @@ cvs_file_walkdir(struct cvs_file *cf, struct cvs_recursion *cr)
/*
* nfs and afs will show d_type as DT_UNKNOWN
* for files and/or directories so when we encounter
- * this we call stat() on the path to be sure.
+ * this we call lstat() on the path to be sure.
*/
if (dp->d_type == DT_UNKNOWN) {
- if (stat(fpath, &st) == -1)
+ if (lstat(fpath, &st) == -1)
fatal("'%s': %s", fpath,
strerror(errno));
diff --git a/usr.bin/cvs/repository.c b/usr.bin/cvs/repository.c
index 5f92673c806..25b11c917df 100644
--- a/usr.bin/cvs/repository.c
+++ b/usr.bin/cvs/repository.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: repository.c,v 1.9 2007/01/25 18:56:33 otto Exp $ */
+/* $OpenBSD: repository.c,v 1.10 2007/02/07 23:47:56 todd Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -119,10 +119,10 @@ cvs_repository_getdir(const char *dir, const char *wdir,
/*
* nfs and afs will show d_type as DT_UNKNOWN
* for files and/or directories so when we encounter
- * this we call stat() on the path to be sure.
+ * this we call lstat() on the path to be sure.
*/
if (dp->d_type == DT_UNKNOWN) {
- if (stat(rpath, &st) == -1)
+ if (lstat(rpath, &st) == -1)
fatal("'%s': %s", rpath, strerror(errno));
switch (st.st_mode & S_IFMT) {
diff --git a/usr.bin/cvs/util.c b/usr.bin/cvs/util.c
index 9896d6ff955..d6964bade62 100644
--- a/usr.bin/cvs/util.c
+++ b/usr.bin/cvs/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.103 2007/01/26 11:19:44 joris Exp $ */
+/* $OpenBSD: util.c,v 1.104 2007/02/07 23:47:56 todd Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* Copyright (c) 2005, 2006 Joris Vink <joris@openbsd.org>
@@ -490,7 +490,7 @@ cvs_rmdir(const char *path)
fatal("cvs_rmdir: path truncation");
if (ent->d_type == DT_UNKNOWN) {
- if (stat(fpath, &st) == -1)
+ if (lstat(fpath, &st) == -1)
fatal("'%s': %s", fpath, strerror(errno));
switch (st.st_mode & S_IFMT) {