From: Denys Vlasenko Date: Mon, 2 Apr 2018 11:34:57 +0000 (+0200) Subject: ash: redir: Fix typo in noclobber code X-Git-Tag: 1_29_0~155 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=355ec353be14f33f69fe3e3992ab5a815b3a01a6;p=oweals%2Fbusybox.git ash: redir: Fix typo in noclobber code Upstream commit "redir: Fix typo in noclobber code" Signed-off-by: Denys Vlasenko --- 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;