]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
update-utmp: rebreak comments
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 6 Apr 2023 19:13:57 +0000 (04:13 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 24 May 2023 11:04:33 +0000 (20:04 +0900)
src/update-utmp/update-utmp.c

index e2faace3f7f91a0f4927da0496cc74b43b1fb905..8f2fa17e6bf0d1064c50f638bc7204867b6f3ec1 100644 (file)
@@ -66,11 +66,9 @@ static int get_current_runlevel(Context *c) {
                 const int runlevel;
                 const char *special;
         } table[] = {
-                /* The first target of this list that is active or has
-                 * a job scheduled wins. We prefer runlevels 5 and 3
-                 * here over the others, since these are the main
-                 * runlevels used on Fedora. It might make sense to
-                 * change the order on some distributions. */
+                /* The first target of this list that is active or has a job scheduled wins. We prefer
+                 * runlevels 5 and 3 here over the others, since these are the main runlevels used on Fedora.
+                 * It might make sense to change the order on some distributions. */
                 { '5', SPECIAL_GRAPHICAL_TARGET  },
                 { '3', SPECIAL_MULTI_USER_TARGET },
                 { '1', SPECIAL_RESCUE_TARGET     },
@@ -111,8 +109,7 @@ static int on_reboot(int argc, char *argv[], void *userdata) {
         usec_t t, boottime;
         int r = 0, q;
 
-        /* We finished start-up, so let's write the utmp
-         * record and send the audit msg */
+        /* We finished start-up, so let's write the utmp record and send the audit msg. */
 
 #if HAVE_AUDIT
         if (c->audit_fd >= 0)
@@ -121,15 +118,13 @@ static int on_reboot(int argc, char *argv[], void *userdata) {
                         r = log_error_errno(errno, "Failed to send audit message: %m");
 #endif
 
-        /* If this call fails it will return 0, which
-         * utmp_put_reboot() will then fix to the current time */
+        /* If this call fails it will return 0, which utmp_put_reboot() will then fix to the current time. */
         t = get_startup_monotonic_time(c);
         boottime = map_clock_usec(t, CLOCK_MONOTONIC, CLOCK_REALTIME);
-        /* We query the recorded monotonic time here (instead of the system clock CLOCK_REALTIME),
-         * even though we actually want the system clock time. That's because there's a likely
-         * chance that the system clock wasn't set right during early boot. By manually converting
-         * the monotonic clock to the system clock here we can compensate
-         * for incorrectly set clocks during early boot. */
+        /* We query the recorded monotonic time here (instead of the system clock CLOCK_REALTIME), even
+         * though we actually want the system clock time. That's because there's a likely chance that the
+         * system clock wasn't set right during early boot. By manually converting the monotonic clock to the
+         * system clock here we can compensate for incorrectly set clocks during early boot. */
 
         q = utmp_put_reboot(boottime);
         if (q < 0)
@@ -141,8 +136,7 @@ static int on_reboot(int argc, char *argv[], void *userdata) {
 static int on_shutdown(int argc, char *argv[], void *userdata) {
         int r = 0, q;
 
-        /* We started shut-down, so let's write the utmp
-         * record and send the audit msg */
+        /* We started shut-down, so let's write the utmp record and send the audit msg. */
 
 #if HAVE_AUDIT
         Context *c = ASSERT_PTR(userdata);
@@ -164,8 +158,7 @@ static int on_runlevel(int argc, char *argv[], void *userdata) {
         Context *c = ASSERT_PTR(userdata);
         int r = 0, q, previous, runlevel;
 
-        /* We finished changing runlevel, so let's write the
-         * utmp record and send the audit msg */
+        /* We finished changing runlevel, so let's write the utmp record and send the audit msg. */
 
         /* First, get last runlevel */
         q = utmp_get_runlevel(&previous, NULL);