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/planix-v0/sys/src/cmd/unix/drawterm/kern/sysproc.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	"lib.h"
3
#include	"dat.h"
4
#include	"fns.h"
5
#include	"error.h"
6
 
7
long
8
sysexits(ulong *arg)
9
{
10
	char *status;
11
	char *inval = "invalid exit string";
12
	char buf[ERRMAX];
13
 
14
	status = (char*)arg[0];
15
	if(status){
16
		if(waserror())
17
			status = inval;
18
		else{
19
			validaddr((ulong)status, 1, 0);
20
			if(vmemchr(status, 0, ERRMAX) == 0){
21
				memmove(buf, status, ERRMAX);
22
				buf[ERRMAX-1] = 0;
23
				status = buf;
24
			}
25
		}
26
		poperror();
27
 
28
	}
29
	pexit(status, 1);
30
	return 0;		/* not reached */
31
}
32