aboutsummaryrefslogtreecommitdiffstats
path: root/doc/man/libhaiku_perror.3
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2016-01-04 23:48:59 +0100
committerMattias Andrée <maandree@member.fsf.org>2016-01-04 23:49:04 +0100
commitfd98286b24a10c2b53f4f4172f68ea8ce46ce1a7 (patch)
tree80b7028db75d11490a1ab5351db8d00ed1b20117 /doc/man/libhaiku_perror.3
parentadd man pages (diff)
downloadlibhaiku-fd98286b24a10c2b53f4f4172f68ea8ce46ce1a7.tar.gz
libhaiku-fd98286b24a10c2b53f4f4172f68ea8ce46ce1a7.tar.bz2
libhaiku-fd98286b24a10c2b53f4f4172f68ea8ce46ce1a7.tar.xz
macro that allows errno == 0
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to 'doc/man/libhaiku_perror.3')
-rw-r--r--doc/man/libhaiku_perror.313
1 files changed, 12 insertions, 1 deletions
diff --git a/doc/man/libhaiku_perror.3 b/doc/man/libhaiku_perror.3
index 7c0476d..1514470 100644
--- a/doc/man/libhaiku_perror.3
+++ b/doc/man/libhaiku_perror.3
@@ -33,7 +33,18 @@ Unlike
.B libhaiku_perror
shall not print anything if
.B errno
-is zero.
+is zero. If you rather it did, you can use the macro
+.PP
+.nf
+#define libhaiku_perror(s) \\
+ do { \\
+ const char *s__ = (s); \\
+ if (errno && s__) \\
+ perror(s__); \\
+ errno = errno ? errno : -1; \\
+ libhaiku_perror(s__); \\
+ } while (0)
+.fi
.SH "SEE ALSO"
.BR libhaiku (7),
.BR perror (3)