if (r < 0)
return r;
} else {
- if (type >= 0 && o->object.type != type)
+ if (type > OBJECT_UNUSED && o->object.type != type)
return -EBADMSG;
}
fd = open(p, O_RDWR|O_CLOEXEC|O_NOCTTY, 0600);
if (fd < 0) {
if (errno != ENOENT)
- log_error("Failed to open %s: %m", p);
+ log_error_errno(errno, "Failed to open %s: %m", p);
r = -errno;
goto finish;