if (f->fss_start_usec == 0 ||
f->fss_interval_usec == 0)
- return -ENOTSUP;
+ return -EOPNOTSUPP;
if (realtime < f->fss_start_usec)
return -ESTALE;
return 0;
}
-int journal_file_hmac_put_object(JournalFile *f, int type, Object *o, uint64_t p) {
+int journal_file_hmac_put_object(JournalFile *f, ObjectType type, Object *o, uint64_t p) {
int r;
assert(f);
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;
e = gcry_md_open(&f->hmac, GCRY_MD_SHA256, GCRY_MD_FLAG_HMAC);
if (e != 0)
- return -ENOTSUP;
+ return -EOPNOTSUPP;
return 0;
}