diff options
author | harti <harti@FreeBSD.org> | 2005-03-08 07:47:14 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2005-03-08 07:47:14 +0000 |
commit | 9719ee7af7c8b60de76c62724d80f8113c15d152 (patch) | |
tree | 567268fa60e34f72b7bcf97041ab472cdbd8d522 /usr.bin/make/util.c | |
parent | d28f5e232e0b1f88280ceb6c41ee4b552d18ac76 (diff) | |
download | FreeBSD-src-9719ee7af7c8b60de76c62724d80f8113c15d152.zip FreeBSD-src-9719ee7af7c8b60de76c62724d80f8113c15d152.tar.gz |
Add a debugging function that prints a message and appends the
current strerror.
Diffstat (limited to 'usr.bin/make/util.c')
-rw-r--r-- | usr.bin/make/util.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/usr.bin/make/util.c b/usr.bin/make/util.c index ba11f4b..e0dbfdc 100644 --- a/usr.bin/make/util.c +++ b/usr.bin/make/util.c @@ -86,6 +86,24 @@ Debug(const char *fmt, ...) } /*- + * Print a debugging message given its format and append the current + * errno description. Terminate with a newline. + */ +/* VARARGS */ +void +DebugM(const char *fmt, ...) +{ + va_list ap; + int e = errno; + + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + fprintf(stderr, ": %s\n", strerror(e)); + va_end(ap); + fflush(stderr); +} + +/*- * Error -- * Print an error message given its format. * |