aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGilles Chehade <gilles@poolp.org>2019-09-19 01:29:51 +0200
committerGilles Chehade <gilles@poolp.org>2019-09-19 01:29:51 +0200
commitc4e7fda43dda4b00d4e57a1ebdaeaf329f09b8a9 (patch)
treedaccb62243170a7c001a7aa6685eae9702ca40b2
parentlink smtp to the build (diff)
parentUpdate bsd-err.c (diff)
downloadOpenSMTPD-c4e7fda43dda4b00d4e57a1ebdaeaf329f09b8a9.tar.xz
OpenSMTPD-c4e7fda43dda4b00d4e57a1ebdaeaf329f09b8a9.zip
Merge branch 'portable' of ssh://github.com/OpenSMTPD/OpenSMTPD into portable
-rw-r--r--openbsd-compat/bsd-err.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/openbsd-compat/bsd-err.c b/openbsd-compat/bsd-err.c
index a73267f9..b8dc4162 100644
--- a/openbsd-compat/bsd-err.c
+++ b/openbsd-compat/bsd-err.c
@@ -43,10 +43,11 @@ err(int r, const char *fmt, ...)
va_start(args, fmt);
fprintf(stderr, "%s: ", __progname);
- fprintf(stderr, "%s", strerror(errno));
- if (fmt != NULL)
- vfprintf(stderr, fmt, args);
- fputc('\n', stderr);
+ if (fmt != NULL) {
+ vfprintf(stderr, fmt, args);
+ fprintf(stderr, ": ");
+ }
+ fprintf(stderr, "%s\n", strerror(errno));
va_end(args);
exit(r);
}
@@ -60,9 +61,9 @@ errx(int r, const char *fmt, ...)
va_start(args, fmt);
fprintf(stderr, "%s: ", __progname);
- if (fmt != NULL)
- vfprintf(stderr, fmt, args);
- fputc('\n', stderr);
+ if (fmt != NULL)
+ vfprintf(stderr, fmt, args);
+ fprintf(stderr, "\n");
va_end(args);
exit(r);
}
@@ -76,12 +77,11 @@ warn(const char *fmt, ...)
va_start(args, fmt);
fprintf(stderr, "%s: ", __progname);
- if (fmt != NULL) {
- vfprintf(stderr, fmt, args);
- fprintf(stderr, ": ");
- }
- fprintf(stderr, "%s", strerror(errno));
- fputc('\n', stderr);
+ if (fmt != NULL) {
+ vfprintf(stderr, fmt, args);
+ fprintf(stderr, ": ");
+ }
+ fprintf(stderr, "%s\n", strerror(errno));
va_end(args);
}
#endif
@@ -94,9 +94,9 @@ warnx(const char *fmt, ...)
va_start(args, fmt);
fprintf(stderr, "%s: ", __progname);
- if (fmt != NULL)
- vfprintf(stderr, fmt, args);
- fputc('\n', stderr);
+ if (fmt != NULL)
+ vfprintf(stderr, fmt, args);
+ fprintf(stderr, "\n");
va_end(args);
}
#endif