chiark / gitweb /
Reintroduce f_type comparison macro
[elogind.git] / src / journal / sd-journal.c
index e92f20b63b84b85b04a9ebec0cad2a44a8f7eeae..15239b5688d8bde6743d80d13f3726b50ff6d77b 100644 (file)
@@ -109,6 +109,9 @@ static void set_location(sd_journal *j, LocationType type, JournalFile *f, Objec
 
         init_location(&j->current_location, type, f, o);
 
+        if (j->current_file)
+                j->current_file->current_offset = 0;
+
         j->current_file = f;
         j->current_field = 0;
 
@@ -1248,15 +1251,15 @@ static void check_network(sd_journal *j, int fd) {
                 return;
 
         j->on_network =
-                CMP_F_TYPE(sfs.f_type, CIFS_MAGIC_NUMBER) ||
-                CMP_F_TYPE(sfs.f_type, CODA_SUPER_MAGIC) ||
-                CMP_F_TYPE(sfs.f_type, NCP_SUPER_MAGIC) ||
-                CMP_F_TYPE(sfs.f_type, NFS_SUPER_MAGIC) ||
-                CMP_F_TYPE(sfs.f_type, SMB_SUPER_MAGIC);
+                F_TYPE_CMP(sfs.f_type, CIFS_MAGIC_NUMBER) ||
+                F_TYPE_CMP(sfs.f_type, CODA_SUPER_MAGIC) ||
+                F_TYPE_CMP(sfs.f_type, NCP_SUPER_MAGIC) ||
+                F_TYPE_CMP(sfs.f_type, NFS_SUPER_MAGIC) ||
+                F_TYPE_CMP(sfs.f_type, SMB_SUPER_MAGIC);
 }
 
 static int add_file(sd_journal *j, const char *prefix, const char *filename) {
-        char _cleanup_free_ *path = NULL;
+        _cleanup_free_ char *path = NULL;
         int r;
         JournalFile *f;
 
@@ -1347,9 +1350,9 @@ static int remove_file(sd_journal *j, const char *prefix, const char *filename)
 }
 
 static int add_directory(sd_journal *j, const char *prefix, const char *dirname) {
-        char _cleanup_free_ *path = NULL;
+        _cleanup_free_ char *path = NULL;
         int r;
-        DIR _cleanup_closedir_ *d = NULL;
+        _cleanup_closedir_ DIR *d = NULL;
         sd_id128_t id, mid;
         Directory *m;
 
@@ -1437,7 +1440,7 @@ static int add_directory(sd_journal *j, const char *prefix, const char *dirname)
 }
 
 static int add_root_directory(sd_journal *j, const char *p) {
-        DIR _cleanup_closedir_ *d = NULL;
+        _cleanup_closedir_ DIR *d = NULL;
         Directory *m;
         int r;