version 1.33, 1995/03/08 01:20:21 |
version 1.34, 1995/04/10 18:28:04 |
Line 167 dup2(p, uap, retval) |
|
Line 167 dup2(p, uap, retval) |
|
if (new != i) |
if (new != i) |
panic("dup2: fdalloc"); |
panic("dup2: fdalloc"); |
} else { |
} else { |
(void) fdclose(p, new); |
(void) fdrelease(p, new); |
} |
} |
return (finishdup(fdp, old, new, retval)); |
return (finishdup(fdp, old, new, retval)); |
} |
} |
Line 345 finishdup(fdp, old, new, retval) |
|
Line 345 finishdup(fdp, old, new, retval) |
|
} |
} |
|
|
int |
int |
fdclose(p, fd) |
fdrelease(p, fd) |
struct proc *p; |
struct proc *p; |
int fd; |
int fd; |
{ |
{ |
Line 382 close(p, uap, retval) |
|
Line 382 close(p, uap, retval) |
|
|
|
if ((u_int)fd >= fdp->fd_nfiles) |
if ((u_int)fd >= fdp->fd_nfiles) |
return (EBADF); |
return (EBADF); |
return (fdclose(p, fd)); |
return (fdrelease(p, fd)); |
} |
} |
|
|
#if defined(COMPAT_43) || defined(COMPAT_SUNOS) || defined(COMPAT_IBCS2) |
#if defined(COMPAT_43) || defined(COMPAT_SUNOS) || defined(COMPAT_IBCS2) |
|
|
|
|
for (fd = 0; fd <= fdp->fd_lastfile; fd++) |
for (fd = 0; fd <= fdp->fd_lastfile; fd++) |
if (fdp->fd_ofileflags[fd] & UF_EXCLOSE) |
if (fdp->fd_ofileflags[fd] & UF_EXCLOSE) |
(void) fdclose(p, fd); |
(void) fdrelease(p, fd); |
} |
} |