mkdir_p(dirname(new), 0755);
snprintf(new, sizeof(new), "%s%s", root, target?target:source);
fd = creat(new, 0644);
- if (fd == -1) {
+ if (fd < 0) {
ERROR("creat(%s) failed: %m\n", new);
return error;
}
int fd;
fd = creat(UJAIL_NOAFILE, 0000);
- if (fd == -1)
+ if (fd < 0)
return;
close(fd);
if (avl_find(&mounts, path))
return 0;
fd = open(path, O_RDONLY|O_CLOEXEC);
- if (fd == -1)
+ if (fd < 0)
return error;
add_mount_bind(path, readonly, error);
} else {
return 0;
char *fullpath;
fd = lib_open(&fullpath, path);
- if (fd == -1)
+ if (fd < 0)
return error;
if (fullpath) {
alloc_library(fullpath, path);