From: Christos Zoulas Date: Fri, 28 Jun 1991 10:36:35 +0000 (-0800) Subject: dmove did not close always close the source file descriptor X-Git-Tag: BSD-4_4-Snapshot-Development~10010 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/21df65307ab77eae8be9b66de7ca40f8dd9c3ae6 dmove did not close always close the source file descriptor SCCS-vsn: bin/csh/misc.c 5.13 --- diff --git a/usr/src/bin/csh/misc.c b/usr/src/bin/csh/misc.c index b5b09fe0c3..55430b61c4 100644 --- a/usr/src/bin/csh/misc.c +++ b/usr/src/bin/csh/misc.c @@ -6,7 +6,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)misc.c 5.12 (Berkeley) %G%"; +static char sccsid[] = "@(#)misc.c 5.13 (Berkeley) %G%"; #endif /* not lint */ #include @@ -249,6 +249,8 @@ dmove(i, j) return (i); if (j >= 0) { (void) dup2(i, j); + if (j != i) + (void) close(i); return (j); } j = dcopy(i, j);