summaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 921367b..28a8bb6 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -4989,9 +4989,13 @@ noclobberopen(const char *fname)
* revealed that it was a regular file, and the file has not been
* replaced, return the file descriptor.
*/
- if (fstat(fd, &finfo2) == 0 && !S_ISREG(finfo2.st_mode)
- && finfo.st_dev == finfo2.st_dev && finfo.st_ino == finfo2.st_ino)
+ if (fstat(fd, &finfo2) == 0
+ && !S_ISREG(finfo2.st_mode)
+ && finfo.st_dev == finfo2.st_dev
+ && finfo.st_ino == finfo2.st_ino
+ ) {
return fd;
+ }
/* The file has been replaced. badness. */
close(fd);