coverity/331377: os_fopen: Remove invalid iflags assert

If the O_* flags were non-zero, then ORing the flags would always be
true.  However, the O_* flags aren't guaranteed to be non-zero, so the
assert is invalid in the first place.
This commit is contained in:
James McCoy 2021-05-06 00:08:06 -04:00
parent d9eaca99be
commit efed75f916
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB

View File

@ -471,8 +471,6 @@ FILE *os_fopen(const char *path, const char *flags)
abort(); abort();
} }
} }
// Per open(2) manpage.
assert((iflags|O_RDONLY) || (iflags|O_WRONLY) || (iflags|O_RDWR));
// Per fopen(3) manpage: default to 0666, it will be umask-adjusted. // Per fopen(3) manpage: default to 0666, it will be umask-adjusted.
int fd = os_open(path, iflags, 0666); int fd = os_open(path, iflags, 0666);
if (fd < 0) { if (fd < 0) {