Added handling of FD_CLOEXEC flag

This commit is contained in:
Jaroslav Kysela 2003-02-04 13:35:59 +00:00
parent e5b227961e
commit a313072961
5 changed files with 43 additions and 11 deletions

View file

@ -447,6 +447,12 @@ int snd_seq_hw_open(snd_seq_t **handle, const char *name, int streams, int mode)
return -errno;
}
}
if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) {
SYSERR("fcntl FD_CLOEXEC failed");
ret = -errno;
close(fd);
return ret;
}
if (ioctl(fd, SNDRV_SEQ_IOCTL_PVERSION, &ver) < 0) {
SYSERR("SNDRV_SEQ_IOCTL_PVERSION failed");
close(fd);