acme: use getuser() in fsinit()

This commit is contained in:
cinap_lenrek 2020-12-19 15:36:07 +01:00
parent 672cf179a1
commit c7fc69bd6a

View file

@ -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);
} }