chiark / gitweb /
mount: don't run quotaon only for network filesystems
[elogind.git] / src / journal / journal-authenticate.c
index bd7100a8d5c86aeaebaf3a52c3373d70743679b2..cdc80e2d26fa89a81607e30eabfc2c53eb1d2659 100644 (file)
@@ -60,7 +60,7 @@ int journal_file_append_tag(JournalFile *f) {
         o->tag.seqnum = htole64(journal_file_tag_seqnum(f));
         o->tag.epoch = htole64(FSPRG_GetEpoch(f->fsprg_state));
 
-        log_debug("Writing tag %"PRIu64" for epoch %"PRIu64"\n",
+        log_debug("Writing tag %"PRIu64" for epoch %"PRIu64"",
                   le64toh(o->tag.seqnum),
                   FSPRG_GetEpoch(f->fsprg_state));
 
@@ -106,7 +106,7 @@ static int journal_file_get_epoch(JournalFile *f, uint64_t realtime, uint64_t *e
 
         if (f->fss_start_usec == 0 ||
             f->fss_interval_usec == 0)
-                return -ENOTSUP;
+                return -EOPNOTSUPP;
 
         if (realtime < f->fss_start_usec)
                 return -ESTALE;
@@ -229,7 +229,7 @@ int journal_file_maybe_append_tag(JournalFile *f, uint64_t realtime) {
         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);
@@ -246,7 +246,7 @@ int journal_file_hmac_put_object(JournalFile *f, int type, Object *o, uint64_t p
                 if (r < 0)
                         return r;
         } else {
-                if (type >= 0 && o->object.type != type)
+                if (type > OBJECT_UNUSED && o->object.type != type)
                         return -EBADMSG;
         }
 
@@ -339,7 +339,7 @@ int journal_file_fss_load(JournalFile *f) {
         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;
@@ -418,10 +418,9 @@ finish:
         if (m)
                 munmap(m, PAGE_ALIGN(sizeof(FSSHeader)));
 
-        if (fd >= 0)
-                close_nointr_nofail(fd);
-
+        safe_close(fd);
         free(p);
+
         return r;
 }
 
@@ -447,7 +446,7 @@ int journal_file_hmac_setup(JournalFile *f) {
 
         e = gcry_md_open(&f->hmac, GCRY_MD_SHA256, GCRY_MD_FLAG_HMAC);
         if (e != 0)
-                return -ENOTSUP;
+                return -EOPNOTSUPP;
 
         return 0;
 }