Skip to content
Snippets Groups Projects
Commit 652e2493 authored by Daniel Salzman's avatar Daniel Salzman
Browse files

knot: fix open pid file return check

parent 72dc78eb
Branches
Tags
No related merge requests found
......@@ -103,7 +103,7 @@ int pid_write(const char* fn)
/* Create file. */
int ret = KNOT_EOK;
int fd = open(fn, O_RDWR|O_CREAT, 0644);
if (fd > 0) {
if (fd >= 0) {
if (write(fd, buf, len) != len)
ret = KNOT_ERROR;
close(fd);
......
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