[prev in list] [next in list] [prev in thread] [next in thread] 

List:       dragonfly-submit
Subject:    Re: sh cleanup
From:       Joerg Sonnenberger <joerg () britannica ! bec ! de>
Date:       2004-03-23 10:12:29
Message-ID: 20040323101229.GD952 () britannica ! bec ! de
[Download RAW message or body]

On Mon, Mar 22, 2004 at 01:44:29PM -0500, Craig Dooley wrote:
> The shell cannot handle some code created by the latest autotools I think,
> so bring in changes from FreeBSD5.  First change removes it's own function 
> copyfd and instead uses dup2.

First a general note. copyfd did some checking on the return value of
fcntl, your dup2 changes don't. The best is IMO to keep copyfd, merge
the close calls into it and do the error checking there.

Second comment above.

Joerg

> 
> -Craig
> -- 
> ------------------------------------------------------------------------
> Craig Dooley                                            craig@xlnx-x.net
> ------------------------------------------------------------------------

> Index: bin/sh/input.c
> ===================================================================
> RCS file: /home/dcvs/src/bin/sh/input.c,v
> retrieving revision 1.4
> diff -u -r1.4 input.c
> --- bin/sh/input.c	19 Mar 2004 18:39:41 -0000	1.4
> +++ bin/sh/input.c	22 Mar 2004 17:20:15 -0000
> @@ -382,7 +382,7 @@
>  	if ((fd = open(fname, O_RDONLY)) < 0)
>  		error("Can't open %s: %s", fname, strerror(errno));
>  	if (fd < 10) {
> -		fd2 = copyfd(fd, 10);
> +		fd2 = fcntl(fd, F_DUPFD, 10);

This seems to be a mistake?

>  		close(fd);
>  		if (fd2 < 0)
>  			error("Out of file descriptors");
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic