fix ipmievd fd closing bug

This commit is contained in:
Duncan Laurie 2006-08-31 22:14:29 +00:00
parent 96dec6ddc7
commit 89199b49f3
2 changed files with 6 additions and 6 deletions

View File

@ -344,7 +344,7 @@ ipmi_open_file(const char * file, int rw)
} }
void void
ipmi_start_daemon(void) ipmi_start_daemon(struct ipmi_intf *intf)
{ {
pid_t pid; pid_t pid;
int fd; int fd;
@ -398,10 +398,10 @@ ipmi_start_daemon(void)
chdir("/"); chdir("/");
umask(0); umask(0);
#if 0 for (fd=0; fd<64; fd++) {
for (fd=0; fd<64; fd++) if (fd != intf->fd)
close(fd); close(fd);
#endif }
open("/dev/null", O_RDWR); open("/dev/null", O_RDWR);
dup(0); dup(0);

View File

@ -667,7 +667,7 @@ ipmievd_main(struct ipmi_event_intf * eintf, int argc, char ** argv)
FILE *fp; FILE *fp;
struct stat st1; struct stat st1;
ipmi_start_daemon(); ipmi_start_daemon(eintf->intf);
if (lstat(pidfile, &st1) == 0) { if (lstat(pidfile, &st1) == 0) {
/* already exists, erase first */ /* already exists, erase first */