summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2018-04-02 13:34:57 +0200
committerDenys Vlasenko2018-04-02 13:34:57 +0200
commit355ec353be14f33f69fe3e3992ab5a815b3a01a6 (patch)
treec6056dce95b4021710d2e9315d076407036bf775
parentc4c2012284c3a3a45843e9400379c84855d853ef (diff)
downloadbusybox-355ec353be14f33f69fe3e3992ab5a815b3a01a6.zip
busybox-355ec353be14f33f69fe3e3992ab5a815b3a01a6.tar.gz
ash: redir: Fix typo in noclobber code
Upstream commit "redir: Fix typo in noclobber code" Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--shell/ash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 70a278f..35ea58f 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -5391,7 +5391,7 @@ openredirect(union node *redir)
f = open(fname, O_WRONLY, 0666);
if (f < 0)
goto ecreate;
- if (fstat(f, &sb) < 0 && S_ISREG(sb.st_mode)) {
+ if (!fstat(f, &sb) && S_ISREG(sb.st_mode)) {
close(f);
errno = EEXIST;
goto ecreate;