Commit 429a3919 authored by Moritz Grimm's avatar Moritz Grimm
Browse files

Fail with assert() if open() fails

This is an attempt to resolve a coverity false positive in a somewhat
sane way.
parent 8c4fb52b
#include <sys/types.h>
#include <sys/stat.h>
#include <assert.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
......@@ -29,7 +30,7 @@ _test_cfgfile_rw(const char *cfgfile)
ck_assert_int_eq(cfg_file_reload(), 0);
fd = open(testfile, O_CREAT|O_EXCL|O_WRONLY, S_IRUSR|S_IWUSR);
ck_assert_int_ge(fd, 0);
assert(0 <= fd);
fp = fdopen(fd, "w");
if (NULL == fp) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment