In fd_init() in filesys.c the namelist file is opened and pc->nfd is initialized:

 

                                if ((pc->nfd = open(pc->namelist, O_RDONLY)) < 0)

                                                error(FATAL, "%s: %s\n", pc->namelist, strerror(errno));

                                else {

                                                close(pc->nfd);

                                                pc->nfd = -1;

                                }

 

 

In the event of a successful open the else clause is executed, and the file that was just opened is closed. Why?

 

 

 

James T. Bradshaw

Firmware Engineer

Enterasys Networks

50 Minuteman Rd.

Andover, MA 01810

USA

Tel. (978) 684-1544