summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2015-07-31 15:01:30 +0200
committerOliver Kiddle <opk@zsh.org>2015-07-31 15:01:30 +0200
commit3d9a8073c236b4cb2f7a237ca83c133e55d49f49 (patch)
treed9513b099f577eb9316626c9427c4c75a70d569c
parent77a8cd73903b06e67b1f427b042a0a90b0191b84 (diff)
downloadzsh-3d9a8073c236b4cb2f7a237ca83c133e55d49f49.tar.gz
zsh-3d9a8073c236b4cb2f7a237ca83c133e55d49f49.tar.xz
zsh-3d9a8073c236b4cb2f7a237ca83c133e55d49f49.zip
35963: simplify condition found by coverity to include tautology
-rw-r--r--ChangeLog3
-rw-r--r--Src/Modules/system.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index fa46e98ce..c638e5f43 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2015-07-31  Oliver Kiddle <opk@zsh.org>
 
+	* 35963: Src/Modules/system.c: simplify condition found by
+	coverity scan to include tautology
+
 	* Matthew Martin: 35960 (tweaked): Completion/Unix/Command/_find:
 	complete correct options for OpenBSD's find
 
diff --git a/Src/Modules/system.c b/Src/Modules/system.c
index a1ed33a96..1ab1fb17e 100644
--- a/Src/Modules/system.c
+++ b/Src/Modules/system.c
@@ -311,8 +311,7 @@ bin_sysopen(char *nam, char **args, Options ops, UNUSED(int func))
     int write = OPT_ISSET(ops, 'w');
     int append = OPT_ISSET(ops, 'a') ? O_APPEND : 0;
     int flags = O_NOCTTY | append | ((append || write) ?
-	(read ? O_RDWR : O_WRONLY) :
-	(!append || read) ? O_RDONLY : O_WRONLY);
+	(read ? O_RDWR : O_WRONLY) : O_RDONLY);
     char *opt, *ptr, *nextopt, *fdvar;
     int o, fd, explicit = -1;
     mode_t perms = 0666;