summary refs log tree commit diff
path: root/src/redir.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/redir.c')
-rw-r--r--src/redir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/redir.c b/src/redir.c
index f96a76b..71b0f77 100644
--- a/src/redir.c
+++ b/src/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;