summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/util.c b/tests/util.c
index a84e475..d212c04 100644
--- a/tests/util.c
+++ b/tests/util.c
@@ -200,14 +200,14 @@ int util_file_write(const char *path)
fd = open(path, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
if (fd < 0)
- return errno;
+ return -errno;
if (write(fd, buf, buf_len) < buf_len) {
- int rc = errno;
+ int rc = -errno;
close(fd);
return rc;
}
if (close(fd) < 0)
- return errno;
+ return -errno;
return 0;
}