mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-03 09:01:52 -05:00
Commented out FD_CLOEXEC fcntl() calls
This commit is contained in:
parent
ee22480d93
commit
073dff1ba1
7 changed files with 61 additions and 0 deletions
|
|
@ -315,12 +315,17 @@ int snd_ctl_hw_open(snd_ctl_t **handle, const char *name, int card, int mode)
|
||||||
if ((fd = open(filename, O_RDWR)) < 0)
|
if ((fd = open(filename, O_RDWR)) < 0)
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
|
/*
|
||||||
|
* this is bogus, an application have to care about open filedescriptors
|
||||||
|
*/
|
||||||
if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) {
|
if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) {
|
||||||
SYSERR("fcntl FD_CLOEXEC failed");
|
SYSERR("fcntl FD_CLOEXEC failed");
|
||||||
err = -errno;
|
err = -errno;
|
||||||
close(fd);
|
close(fd);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (ioctl(fd, SNDRV_CTL_IOCTL_PVERSION, &ver) < 0) {
|
if (ioctl(fd, SNDRV_CTL_IOCTL_PVERSION, &ver) < 0) {
|
||||||
err = -errno;
|
err = -errno;
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
|
||||||
|
|
@ -120,12 +120,17 @@ int snd_hwdep_hw_open(snd_hwdep_t **handle, const char *name, int card, int devi
|
||||||
if ((fd = open(filename, mode)) < 0)
|
if ((fd = open(filename, mode)) < 0)
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
|
/*
|
||||||
|
* this is bogus, an application have to care about open filedescriptors
|
||||||
|
*/
|
||||||
if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) {
|
if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) {
|
||||||
SYSERR("fcntl FD_CLOEXEC failed");
|
SYSERR("fcntl FD_CLOEXEC failed");
|
||||||
ret = -errno;
|
ret = -errno;
|
||||||
close(fd);
|
close(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (ioctl(fd, SNDRV_HWDEP_IOCTL_PVERSION, &ver) < 0) {
|
if (ioctl(fd, SNDRV_HWDEP_IOCTL_PVERSION, &ver) < 0) {
|
||||||
ret = -errno;
|
ret = -errno;
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
|
||||||
|
|
@ -4988,6 +4988,37 @@ void snd_pcm_sw_params_copy(snd_pcm_sw_params_t *dst, const snd_pcm_sw_params_t
|
||||||
*dst = *src;
|
*dst = *src;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set boundary for ring pointers inside a software configuration container
|
||||||
|
* \param pcm PCM handle
|
||||||
|
* \param params Software configuration container
|
||||||
|
* \param val boundary in frames
|
||||||
|
* \return 0 otherwise a negative error code
|
||||||
|
*/
|
||||||
|
#ifndef DOXYGEN
|
||||||
|
int snd_pcm_sw_params_set_boundary(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val)
|
||||||
|
#else
|
||||||
|
int snd_pcm_sw_params_set_boundary(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
assert(pcm && params);
|
||||||
|
params->boundary = val;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Get boundary for ring pointers from a software configuration container
|
||||||
|
* \param params Software configuration container
|
||||||
|
* \param val Returned boundary in frames
|
||||||
|
* \return 0 otherwise a negative error code
|
||||||
|
*/
|
||||||
|
int snd_pcm_sw_params_get_boundary(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val)
|
||||||
|
{
|
||||||
|
assert(params);
|
||||||
|
*val = params->boundary;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief (DEPRECATED) Set start mode inside a software configuration container
|
* \brief (DEPRECATED) Set start mode inside a software configuration container
|
||||||
* \param pcm PCM handle
|
* \param pcm PCM handle
|
||||||
|
|
|
||||||
|
|
@ -845,12 +845,17 @@ int snd_pcm_hw_open_fd(snd_pcm_t **pcmp, const char *name,
|
||||||
if (fmode & O_ASYNC)
|
if (fmode & O_ASYNC)
|
||||||
mode |= SND_PCM_ASYNC;
|
mode |= SND_PCM_ASYNC;
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/*
|
||||||
|
* this is bogus, an application have to care about open filedescriptors
|
||||||
|
*/
|
||||||
if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) {
|
if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) {
|
||||||
ret = -errno;
|
ret = -errno;
|
||||||
SYSERR("fcntl FD_CLOEXEC failed");
|
SYSERR("fcntl FD_CLOEXEC failed");
|
||||||
close(fd);
|
close(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (ioctl(fd, SNDRV_PCM_IOCTL_PVERSION, &ver) < 0) {
|
if (ioctl(fd, SNDRV_PCM_IOCTL_PVERSION, &ver) < 0) {
|
||||||
ret = -errno;
|
ret = -errno;
|
||||||
|
|
|
||||||
|
|
@ -228,12 +228,17 @@ int snd_rawmidi_hw_open(snd_rawmidi_t **inputp, snd_rawmidi_t **outputp,
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
|
/*
|
||||||
|
* this is bogus, an application have to care about open filedescriptors
|
||||||
|
*/
|
||||||
if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) {
|
if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) {
|
||||||
SYSERR("fcntl FD_CLOEXEC failed");
|
SYSERR("fcntl FD_CLOEXEC failed");
|
||||||
ret = -errno;
|
ret = -errno;
|
||||||
close(fd);
|
close(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (ioctl(fd, SNDRV_RAWMIDI_IOCTL_PVERSION, &ver) < 0) {
|
if (ioctl(fd, SNDRV_RAWMIDI_IOCTL_PVERSION, &ver) < 0) {
|
||||||
ret = -errno;
|
ret = -errno;
|
||||||
SYSERR("SNDRV_RAWMIDI_IOCTL_PVERSION failed");
|
SYSERR("SNDRV_RAWMIDI_IOCTL_PVERSION failed");
|
||||||
|
|
|
||||||
|
|
@ -447,12 +447,17 @@ int snd_seq_hw_open(snd_seq_t **handle, const char *name, int streams, int mode)
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
|
/*
|
||||||
|
* this is bogus, an application have to care about open filedescriptors
|
||||||
|
*/
|
||||||
if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) {
|
if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) {
|
||||||
SYSERR("fcntl FD_CLOEXEC failed");
|
SYSERR("fcntl FD_CLOEXEC failed");
|
||||||
ret = -errno;
|
ret = -errno;
|
||||||
close(fd);
|
close(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (ioctl(fd, SNDRV_SEQ_IOCTL_PVERSION, &ver) < 0) {
|
if (ioctl(fd, SNDRV_SEQ_IOCTL_PVERSION, &ver) < 0) {
|
||||||
SYSERR("SNDRV_SEQ_IOCTL_PVERSION failed");
|
SYSERR("SNDRV_SEQ_IOCTL_PVERSION failed");
|
||||||
ret = -errno;
|
ret = -errno;
|
||||||
|
|
|
||||||
|
|
@ -172,12 +172,17 @@ int snd_timer_hw_open(snd_timer_t **handle, const char *name, int dev_class, int
|
||||||
tmode |= O_NONBLOCK;
|
tmode |= O_NONBLOCK;
|
||||||
if ((fd = open(SNDRV_FILE_TIMER, tmode)) < 0)
|
if ((fd = open(SNDRV_FILE_TIMER, tmode)) < 0)
|
||||||
return -errno;
|
return -errno;
|
||||||
|
#if 0
|
||||||
|
/*
|
||||||
|
* this is bogus, an application have to care about open filedescriptors
|
||||||
|
*/
|
||||||
if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) {
|
if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) {
|
||||||
SYSERR("fcntl FD_CLOEXEC failed");
|
SYSERR("fcntl FD_CLOEXEC failed");
|
||||||
ret = -errno;
|
ret = -errno;
|
||||||
close(fd);
|
close(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (ioctl(fd, SNDRV_TIMER_IOCTL_PVERSION, &ver) < 0) {
|
if (ioctl(fd, SNDRV_TIMER_IOCTL_PVERSION, &ver) < 0) {
|
||||||
ret = -errno;
|
ret = -errno;
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue