Move werrstr into errstr, so that if you use werrstr

you have to get this __errfmt instead of the one
in libfmt that only does Unix error codes.
This commit is contained in:
rsc 2003-10-14 02:10:47 +00:00
parent 8110278003
commit 169aba14a4
3 changed files with 14 additions and 14 deletions

View file

@ -16,10 +16,12 @@ OFILES=\
lock.$O\ lock.$O\
malloctag.$O\ malloctag.$O\
mallocz.$O\ mallocz.$O\
netmkaddr.$O\
nrand.$O\ nrand.$O\
qlock.$O\ qlock.$O\
readn.$O\ readn.$O\
rendez-$(SYSNAME).$O\ rendez-$(SYSNAME).$O\
sleep.$O\
strecpy.$O\ strecpy.$O\
sysfatal.$O\ sysfatal.$O\
tas-$(OBJTYPE).$O\ tas-$(OBJTYPE).$O\
@ -28,7 +30,6 @@ OFILES=\
u32.$O\ u32.$O\
u64.$O\ u64.$O\
wait.$O\ wait.$O\
werrstr.$O\
HFILES=\ HFILES=\
$(PLAN9)/include/lib9.h\ $(PLAN9)/include/lib9.h\

View file

@ -66,3 +66,15 @@ __errfmt(Fmt *f)
return fmtstrcpy(f, getsyserr()); return fmtstrcpy(f, getsyserr());
return fmtstrcpy(f, strerror(errno)); return fmtstrcpy(f, strerror(errno));
} }
void
werrstr(char *fmt, ...)
{
va_list arg;
char buf[ERRMAX];
va_start(arg, fmt);
vseprint(buf, buf+ERRMAX, fmt, arg);
va_end(arg);
errstr(buf, ERRMAX);
}

View file

@ -1,13 +0,0 @@
#include <lib9.h>
void
werrstr(char *fmt, ...)
{
va_list arg;
char buf[ERRMAX];
va_start(arg, fmt);
vseprint(buf, buf+ERRMAX, fmt, arg);
va_end(arg);
errstr(buf, ERRMAX);
}