mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-10 01:17:44 +03:00
man: recommend strerror_r() over strerror()
Let's nudge people towards the use of an anonymous buffer like we do internally. "errno" → "errnum", to match the man page for strerror, and also to avoid confusion with the global variable. In general, I think that errno is a terrible interface and we shouldn't encourage people to use it. Those functions use errno-style error numbers, which are a different thing.
This commit is contained in:
parent
b4096cecff
commit
2fd922afed
@ -268,7 +268,7 @@
|
||||
<citerefentry><refentrytitle>sd_bus_error</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
|
||||
<citerefentry><refentrytitle>sd_bus_message_set_allow_interactive_authorization</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
|
||||
<citerefentry project='man-pages'><refentrytitle>errno</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
|
||||
<citerefentry project='die-net'><refentrytitle>strerror</refentrytitle><manvolnum>3</manvolnum></citerefentry>
|
||||
<citerefentry project='die-net'><refentrytitle>strerror_r</refentrytitle><manvolnum>3</manvolnum></citerefentry>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -424,8 +424,8 @@
|
||||
|
||||
<programlisting>sd_notifyf(0, "STATUS=Failed to start up: %s\n"
|
||||
"ERRNO=%i",
|
||||
strerror(errno),
|
||||
errno);</programlisting>
|
||||
strerror_r(errnum, (char[1024]){}, 1024),
|
||||
errnum);</programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
|
@ -260,8 +260,8 @@ int sd_notify(int unset_environment, const char *state);
|
||||
|
||||
sd_notifyf(0, "STATUS=Failed to start up: %s\n"
|
||||
"ERRNO=%i",
|
||||
strerror(errno),
|
||||
errno);
|
||||
strerror_r(errnum, (char[1024]){}, 1024),
|
||||
errnum);
|
||||
|
||||
See sd_notifyf(3) for more information.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user