From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Wed, 2 Sep 1998 07:25:29 -0400 From: arisawa@ar.aichi-u.ac.jp arisawa@ar.aichi-u.ac.jp Subject: [9fans] 9tftpd Topicbox-Message-UUID: 7e314abc-eac8-11e9-9e20-41e7f4b1d025 Message-ID: <19980902112529.YsaSf2Tmj7CVAce1LHOZAg9OgmI2nNDPawzRvdoUHm4@z> Hello 9fans. I received bug report of 9tftpd from beleos@plan9.cs.unr.edu. Thanks, Kenji Arisawa E-mail: arisawa@aichi-u.ac.jp ---------------------- bug report ------------------ It is working fine except for one problem - after a number of bootp's (about 10 or so) 9tftpd eventually fails with a "tftpopen: error (0): no free file descriptors" message. The file descriptor leak appears to be in the ip2bootf function. Adding 2 ndbclose() statements appears to fix the problem. old: db = ndbopen(0); if(db == 0) return 0; if(ipinfo(db, 0, ip, 0, &info) < 0) return 0; if(info.bootf[0]) return info.bootf; return 0; new: db = ndbopen(0); if(db == 0) return 0; if(ipinfo(db, 0, ip, 0, &info) < 0) { ndbclose(db); return 0; } if(info.bootf[0]) { ndbclose(db); return info.bootf; } return 0;