[git commit] ash: redir: Fix typo in noclobber code
Denys Vlasenko
vda.linux at googlemail.com
Mon Apr 2 11:34:57 UTC 2018
commit: https://git.busybox.net/busybox/commit/?id=355ec353be14f33f69fe3e3992ab5a815b3a01a6
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master
Upstream commit "redir: Fix typo in noclobber code"
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
shell/ash.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/shell/ash.c b/shell/ash.c
index 70a278f42..35ea58f3a 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;
More information about the busybox-cvs
mailing list