]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - man/sd_login_monitor_new.xml
man: document systemd-bless-boot
[thirdparty/systemd.git] / man / sd_login_monitor_new.xml
index 23f685bb3184455e3bd581fce2e7f9c1b0a572af..d914e51d0d98a780a0539d7285776d3a0303860d 100644 (file)
     code block is left:</para>
 
     <programlisting>{
-        __attribute__((cleanup(sd_login_monitor_unrefp)) sd_login_monitor *m = NULL;
-        int r;
-        
-        r = sd_login_monitor_default(&amp;m);
-        if (r &lt; 0)
-                fprintf(stderr, "Failed to allocate login monitor object: %s\n", strerror(-r));
-        
+  __attribute__((cleanup(sd_login_monitor_unrefp)) sd_login_monitor *m = NULL;
+  int r;
+  …
+  r = sd_login_monitor_default(&amp;m);
+  if (r &lt; 0)
+    fprintf(stderr, "Failed to allocate login monitor object: %s\n", strerror(-r));
+  …
 }</programlisting>
 
     <para><function>sd_login_monitor_flush()</function> may be used to
 int msec;
 sd_login_monitor_get_timeout(m, &amp;t);
 if (t == (uint64_t) -1)
-         msec = -1;
+  msec = -1;
 else {
-         struct timespec ts;
-         uint64_t n;
-         clock_gettime(CLOCK_MONOTONIC, &amp;ts);
-         n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
-         msec = t > n ? (int) ((t - n + 999) / 1000) : 0;
+  struct timespec ts;
+  uint64_t n;
+  clock_gettime(CLOCK_MONOTONIC, &amp;ts);
+  n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
+  msec = t > n ? (int) ((t - n + 999) / 1000) : 0;
 }</programlisting>
 
     <para>The code above does not do any error checking for brevity's