diff options
author | Darren Tucker <dtucker@zip.com.au> | 2005-11-10 17:15:06 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2005-11-10 17:15:06 +1100 |
commit | 0a149d19d3ca291c33f449c304d4b0c5601c127a (patch) | |
tree | dd1df512463158d0cfde65dd806d13677e8e14d8 /openbsd-compat/getcwd.c | |
parent | 31ba53e333458abda2337f5d3ded0205485bd355 (diff) |
- (dtucker) [openbsd-compat/getcwd.c] Replace lstat with fstat to match up
with OpenBSD code since we don't support platforms without fstat any more.
Diffstat (limited to 'openbsd-compat/getcwd.c')
-rw-r--r-- | openbsd-compat/getcwd.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/openbsd-compat/getcwd.c b/openbsd-compat/getcwd.c index 9354f7ae..711cb9cd 100644 --- a/openbsd-compat/getcwd.c +++ b/openbsd-compat/getcwd.c @@ -144,10 +144,8 @@ getcwd(char *pt, size_t size) *bup++ = '.'; *bup = '\0'; - /* Open and stat parent directory. - * RACE?? - replaced fstat(dirfd(dir), &s) w/ lstat(up,&s) - */ - if (!(dir = opendir(up)) || lstat(up,&s)) + /* Open and stat parent directory. */ + if (!(dir = opendir(up)) || fstat(dirfd(dir), &s)) goto err; /* Add trailing slash for next directory. */ |