diff options
Diffstat (limited to 'kernel/proc')
-rw-r--r-- | kernel/proc/proc.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/kernel/proc/proc.c b/kernel/proc/proc.c index 1e38ca8..91be451 100644 --- a/kernel/proc/proc.c +++ b/kernel/proc/proc.c @@ -260,6 +260,20 @@ void proc_cleanup(long status) // NOT_YET_IMPLEMENTED("PROCS: proc_cleanup"); dbg(DBG_PROC, "proc_cleanup called on proc with pid=%d with exit status=%d\n", curproc->p_pid, status); +#ifdef __VFS__ + for (int fd = 0; fd < NFILES; fd++) + { + if (curproc->p_files[fd]) + { + fput(curproc->p_files + fd); + } + } + if (curproc->p_cwd) + { + vput(&curproc->p_cwd); + } +#endif + if (curproc->p_pid == PID_INIT) { @@ -289,20 +303,6 @@ void proc_cleanup(long status) // } else { curproc->p_status = status; // } - -#ifdef __VFS__ - for (int fd = 0; fd < NFILES; fd++) - { - if (curproc->p_files[fd]) - { - fput(curproc->p_files + fd); - } - } - if (curproc->p_cwd) - { - vput(&curproc->p_cwd); - } -#endif } /* |