chiark / gitweb /
Reintroduce f_type comparison macro
[elogind.git] / src / journal / sd-journal.c
index 88af68c1f1a2c73d26d3856db786d7d9e96d9419..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,11 +1251,11 @@ static void check_network(sd_journal *j, int fd) {
                 return;
 
         j->on_network =
-                sfs.f_type == (__SWORD_TYPE) CIFS_MAGIC_NUMBER ||
-                sfs.f_type == (__SWORD_TYPE) CODA_SUPER_MAGIC ||
-                sfs.f_type == (__SWORD_TYPE) NCP_SUPER_MAGIC ||
-                sfs.f_type == (__SWORD_TYPE) NFS_SUPER_MAGIC ||
-                sfs.f_type == (__SWORD_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) {