[Crash-utility] fd_init()

Bradshaw, James jbradsha at enterasys.com
Thu Dec 11 17:15:28 UTC 2008


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20081211/d530e4e7/attachment.htm>


More information about the Crash-utility mailing list