klibc-bot for Herbert Xu
2020-Mar-28 21:49 UTC
[klibc] [klibc:update-dash] dash: redir: Fix typo in noclobber code
Commit-ID: 4265f8d559e294cc39afce8cc6849341db751b0b Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=4265f8d559e294cc39afce8cc6849341db751b0b Author: Herbert Xu <herbert at gondor.apana.org.au> AuthorDate: Mon, 26 Mar 2018 18:33:49 +0800 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Sat, 28 Mar 2020 21:42:54 +0000 [klibc] dash: redir: Fix typo in noclobber code [ dash commit c22e9cc693a6271533740abd9be1bf918a40b0b3 ] The noclobber code has a typo in it that causes it to fail. This patch fixes it. Reported-by: Denys Vlasenko <vda.linux at googlemail.com> Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/redir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/dash/redir.c b/usr/dash/redir.c index f96a76bc..71b0f774 100644 --- a/usr/dash/redir.c +++ b/usr/dash/redir.c @@ -192,7 +192,7 @@ openredirect(union node *redir) } else if (!S_ISREG(sb.st_mode)) { if ((f = open64(fname, O_WRONLY, 0666)) < 0) goto ecreate; - if (fstat64(f, &sb) < 0 && S_ISREG(sb.st_mode)) { + if (!fstat64(f, &sb) && S_ISREG(sb.st_mode)) { close(f); errno = EEXIST; goto ecreate;
Reasonably Related Threads
- [klibc:update-dash] redir: Fix typo in noclobber code
- [klibc:update-dash] dash: redir: Handle nested exec within REALLY_CLOSED redirection
- [git patch] klibc dash 0.5.4 update
- When a shell says no (clobber) it means maybe.
- [klibc:update-dash] dash: parser: Fix old-style command substitution here-document crash