man/sd_notify: fix indentation in sample programs

Whether we use a newline at the beginning of <programlisting> or not doesn't
seem to have any effect. So let's use the newline in multi-line examples; it is
easier to get the indentation right this way.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2023-01-22 17:51:30 +01:00
parent a9ba6f8a88
commit 066991f9fe

View File

@@ -436,10 +436,11 @@
<para>A service could send the following after completing
initialization:</para>
<programlisting>sd_notifyf(0, "READY=1\n"
"STATUS=Processing requests…\n"
"MAINPID=%lu",
(unsigned long) getpid());</programlisting>
<programlisting>
sd_notifyf(0, "READY=1\n"
"STATUS=Processing requests…\n"
"MAINPID=%lu",
(unsigned long) getpid());</programlisting>
</example>
<example>
@@ -447,10 +448,11 @@
<para>A service could send the following shortly before exiting, on failure:</para>
<programlisting>sd_notifyf(0, "STATUS=Failed to start up: %s\n"
"ERRNO=%i",
strerror_r(errnum, (char[1024]){}, 1024),
errnum);</programlisting>
<programlisting>
sd_notifyf(0, "STATUS=Failed to start up: %s\n"
"ERRNO=%i",
strerror_r(errnum, (char[1024]){}, 1024),
errnum);</programlisting>
</example>
<example>
@@ -473,9 +475,10 @@
to synchronize against reception of all notifications sent before
this call is made.</para>
<programlisting>sd_notify(0, "READY=1");
/* set timeout to 5 seconds */
sd_notify_barrier(0, 5 * 1000000);
<programlisting>
sd_notify(0, "READY=1");
/* set timeout to 5 seconds */
sd_notify_barrier(0, 5 * 1000000);
</programlisting>
</example>
</refsect1>