acme: use getuser() in fsinit()
This commit is contained in:
parent
672cf179a1
commit
c7fc69bd6a
1 changed files with 1 additions and 11 deletions
|
@ -116,8 +116,6 @@ void
|
||||||
fsysinit(void)
|
fsysinit(void)
|
||||||
{
|
{
|
||||||
int p[2];
|
int p[2];
|
||||||
int n, fd;
|
|
||||||
char buf[256];
|
|
||||||
|
|
||||||
if(pipe(p) < 0)
|
if(pipe(p) < 0)
|
||||||
error("can't create pipe");
|
error("can't create pipe");
|
||||||
|
@ -125,15 +123,7 @@ fsysinit(void)
|
||||||
sfd = p[1];
|
sfd = p[1];
|
||||||
fmtinstall('F', fcallfmt);
|
fmtinstall('F', fcallfmt);
|
||||||
clockfd = open("/dev/time", OREAD|OCEXEC);
|
clockfd = open("/dev/time", OREAD|OCEXEC);
|
||||||
fd = open("/dev/user", OREAD);
|
user = getuser();
|
||||||
if(fd >= 0){
|
|
||||||
n = read(fd, buf, sizeof buf-1);
|
|
||||||
if(n > 0){
|
|
||||||
buf[n] = 0;
|
|
||||||
user = estrdup(buf);
|
|
||||||
}
|
|
||||||
close(fd);
|
|
||||||
}
|
|
||||||
proccreate(fsysproc, nil, STACK);
|
proccreate(fsysproc, nil, STACK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue