summaryrefslogtreecommitdiff
path: root/src/systemd/sd-daemon.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-10-07 16:24:01 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-10-11 16:59:00 +0200
commit2fd922afed57c9a068c6d877b88d41391bea9721 (patch)
tree855fec6b73974f534e4998ea2ecbdf9b68fb76c6 /src/systemd/sd-daemon.h
parentb4096cecffd13491848b84bc27f00dbee06af52e (diff)
downloadsystemd-2fd922afed57c9a068c6d877b88d41391bea9721.tar.gz
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.
Diffstat (limited to 'src/systemd/sd-daemon.h')
-rw-r--r--src/systemd/sd-daemon.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/systemd/sd-daemon.h b/src/systemd/sd-daemon.h
index 442b0ac604..53a1d7ccfe 100644
--- a/src/systemd/sd-daemon.h
+++ b/src/systemd/sd-daemon.h
@@ -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.
*/