kernel: do not inherit Proc.dot (current working directory) in kproc()
making sure to close the dot in every kproc appears repetitive, so instead stop inheriting the dot in kproc() as this is usually never what you wanted in the first place.
This commit is contained in:
parent
b48078c12c
commit
58dc03cec0
4 changed files with 1 additions and 17 deletions
|
@ -1387,7 +1387,7 @@ kproc(char *name, void (*func)(void *), void *arg)
|
|||
p->s = up->s;
|
||||
p->nerrlab = 0;
|
||||
p->slash = up->slash;
|
||||
p->dot = up->dot;
|
||||
p->dot = up->slash; /* unlike fork, do not inherit the dot for kprocs */
|
||||
if(p->dot != nil)
|
||||
incref(p->dot);
|
||||
|
||||
|
|
|
@ -837,10 +837,6 @@ segmentioproc(void *arg)
|
|||
incref(sio->s);
|
||||
up->seg[sno] = sio->s;
|
||||
|
||||
cclose(up->dot);
|
||||
up->dot = up->slash;
|
||||
incref(up->dot);
|
||||
|
||||
while(waserror())
|
||||
;
|
||||
for(done = 0; !done;){
|
||||
|
|
|
@ -149,10 +149,6 @@ pager(void*)
|
|||
Segment *s;
|
||||
Proc *p, *ep;
|
||||
|
||||
cclose(up->dot);
|
||||
up->dot = up->slash;
|
||||
incref(up->dot);
|
||||
|
||||
p = proctab(0);
|
||||
ep = &p[conf.nproc];
|
||||
|
||||
|
|
|
@ -116,10 +116,6 @@ cursorproc(void *arg)
|
|||
|
||||
up->seg[i] = arg;
|
||||
|
||||
cclose(up->dot);
|
||||
up->dot = up->slash;
|
||||
incref(up->dot);
|
||||
|
||||
hwcursor.proc = up;
|
||||
if(waserror()){
|
||||
hwcursor.addr = 0;
|
||||
|
@ -204,10 +200,6 @@ screenproc(void *arg)
|
|||
|
||||
up->seg[sno] = arg;
|
||||
|
||||
cclose(up->dot);
|
||||
up->dot = up->slash;
|
||||
incref(up->dot);
|
||||
|
||||
fbscreen.proc = up;
|
||||
if(waserror()){
|
||||
fbscreen.addr = 0;
|
||||
|
|
Loading…
Reference in a new issue