Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature_posix/sys/src/libsunrpc/error.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include <u.h>
2
#include <libc.h>
3
#include <thread.h>
4
#include <sunrpc.h>
5
 
6
static struct {
7
	SunStatus status;
8
	char *msg;
9
} tab[] = {
10
	SunProgUnavail,	"program unavailable",
11
	SunProgMismatch,	"program mismatch",
12
	SunProcUnavail,	"procedure unavailable",
13
	SunGarbageArgs,	"garbage args",
14
	SunSystemErr,		"system error",
15
	SunRpcMismatch,	"rpc mismatch",
16
	SunAuthBadCred,	"bad auth cred",
17
	SunAuthRejectedCred,	"rejected auth cred",
18
	SunAuthBadVerf,	"bad auth verf",
19
	SunAuthRejectedVerf,	"rejected auth verf",
20
	SunAuthTooWeak,	"auth too weak",
21
	SunAuthInvalidResp,	"invalid auth response",
22
	SunAuthFailed,		"auth failed",
23
};
24
 
25
void
26
sunErrstr(SunStatus status)
27
{
28
	int i;
29
 
30
	for(i=0; i<nelem(tab); i++){
31
		if(tab[i].status == status){
32
			werrstr(tab[i].msg);
33
			return;
34
		}
35
	}
36
	werrstr("unknown sun error %d", (int)status);
37
}