]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journalctl: rename boot_id_t to BootId
authorLennart Poettering <lennart@poettering.net>
Mon, 18 May 2015 22:24:27 +0000 (00:24 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 18 May 2015 22:26:48 +0000 (00:26 +0200)
So far we tried to reserve the _t suffix to types we use like a value in
contrast to types we use as objects, hence let's do this in journalctl
too.

src/journal/journalctl.c

index d0cc5d9b2ee76c9fa37fffd6510e385e30dbd1f9..c9a259add06cb34d0bc7d7154a597c182018be66 100644 (file)
@@ -125,12 +125,12 @@ static enum {
         ACTION_VACUUM,
 } arg_action = ACTION_SHOW;
 
-typedef struct boot_id_t {
+typedef struct BootId {
         sd_id128_t id;
         uint64_t first;
         uint64_t last;
-        LIST_FIELDS(struct boot_id_t, boot_list);
-} boot_id_t;
+        LIST_FIELDS(struct BootId, boot_list);
+} BootId;
 
 static void pager_open_if_enabled(void) {
 
@@ -858,13 +858,15 @@ static int add_matches(sd_journal *j, char **args) {
         return 0;
 }
 
-static int discover_next_boot(sd_journal *j,
-                              boot_id_t **boot,
-                              bool advance_older,
-                              bool read_realtime) {
+static int discover_next_boot(
+                sd_journal *j,
+                BootId **boot,
+                bool advance_older,
+                bool read_realtime) {
+
         int r;
         char match[9+32+1] = "_BOOT_ID=";
-        _cleanup_free_ boot_id_t *next_boot = NULL;
+        _cleanup_free_ BootId *next_boot = NULL;
 
         assert(j);
         assert(boot);
@@ -889,7 +891,7 @@ static int discover_next_boot(sd_journal *j,
         else if (r == 0)
                 return 0; /* End of journal, yay. */
 
-        next_boot = new0(boot_id_t, 1);
+        next_boot = new0(BootId, 1);
         if (!next_boot)
                 return log_oom();
 
@@ -936,13 +938,15 @@ static int discover_next_boot(sd_journal *j,
         return 0;
 }
 
-static int get_boots(sd_journal *j,
-                     boot_id_t **boots,
-                     boot_id_t *query_ref_boot,
-                     int ref_boot_offset) {
+static int get_boots(
+                sd_journal *j,
+                BootId **boots,
+                BootId *query_ref_boot,
+                int ref_boot_offset) {
+
         bool skip_once;
         int r, count = 0;
-        boot_id_t *head = NULL, *tail = NULL;
+        BootId *head = NULL, *tail = NULL;
         const bool advance_older = query_ref_boot && ref_boot_offset <= 0;
 
         assert(j);
@@ -997,12 +1001,12 @@ static int get_boots(sd_journal *j,
                 /* No sd_journal_next/previous here. */
         }
 
-        while (true) {
-                _cleanup_free_ boot_id_t *current = NULL;
+        for (;;) {
+                _cleanup_free_ BootId *current = NULL;
 
                 r = discover_next_boot(j, &current, advance_older, !query_ref_boot);
                 if (r < 0) {
-                        boot_id_t *id, *id_next;
+                        BootId *id, *id_next;
                         LIST_FOREACH_SAFE(boot_list, id, id_next, head)
                                 free(id);
                         return r;
@@ -1040,7 +1044,7 @@ finish:
 
 static int list_boots(sd_journal *j) {
         int w, i, count;
-        boot_id_t *id, *id_next, *all_ids;
+        BootId *id, *id_next, *all_ids;
 
         assert(j);
 
@@ -1072,7 +1076,7 @@ static int list_boots(sd_journal *j) {
 static int add_boot(sd_journal *j) {
         char match[9+32+1] = "_BOOT_ID=";
         int r;
-        boot_id_t ref_boot_id = {};
+        BootId ref_boot_id = {};
 
         assert(j);