mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-29 21:37:54 -04:00
treewide: replace EBADFD with posix EBADF
EBADF was used in some places already, some other places used EBADFD (with and without an #ifdef). EBADFD is linux specific.
This commit is contained in:
parent
db8bb8d489
commit
7303a55b50
4 changed files with 12 additions and 16 deletions
|
|
@ -286,7 +286,7 @@ static int pipewire_elem_count(snd_ctl_ext_t * ext)
|
|||
assert(ctl);
|
||||
|
||||
if (!ctl->mainloop)
|
||||
return -EBADFD;
|
||||
return -EBADF;
|
||||
|
||||
pw_thread_loop_lock(ctl->mainloop);
|
||||
|
||||
|
|
@ -322,7 +322,7 @@ static int pipewire_elem_list(snd_ctl_ext_t * ext, unsigned int offset,
|
|||
assert(ctl);
|
||||
|
||||
if (!ctl->mainloop)
|
||||
return -EBADFD;
|
||||
return -EBADF;
|
||||
|
||||
snd_ctl_elem_id_set_interface(id, SND_CTL_ELEM_IFACE_MIXER);
|
||||
|
||||
|
|
@ -393,7 +393,7 @@ static int pipewire_get_attribute(snd_ctl_ext_t * ext, snd_ctl_ext_key_t key,
|
|||
assert(ctl);
|
||||
|
||||
if (!ctl->mainloop)
|
||||
return -EBADFD;
|
||||
return -EBADF;
|
||||
|
||||
pw_thread_loop_lock(ctl->mainloop);
|
||||
|
||||
|
|
@ -449,7 +449,7 @@ static int pipewire_read_integer(snd_ctl_ext_t * ext, snd_ctl_ext_key_t key,
|
|||
assert(ctl);
|
||||
|
||||
if (!ctl->mainloop)
|
||||
return -EBADFD;
|
||||
return -EBADF;
|
||||
|
||||
pw_thread_loop_lock(ctl->mainloop);
|
||||
|
||||
|
|
@ -583,7 +583,7 @@ static int pipewire_write_integer(snd_ctl_ext_t * ext, snd_ctl_ext_key_t key,
|
|||
assert(ctl);
|
||||
|
||||
if (!ctl->mainloop)
|
||||
return -EBADFD;
|
||||
return -EBADF;
|
||||
|
||||
pw_thread_loop_lock(ctl->mainloop);
|
||||
|
||||
|
|
@ -682,7 +682,7 @@ static int pipewire_read_event(snd_ctl_ext_t * ext, snd_ctl_elem_id_t * id,
|
|||
assert(ctl);
|
||||
|
||||
if (!ctl->mainloop)
|
||||
return -EBADFD;
|
||||
return -EBADF;
|
||||
|
||||
pw_thread_loop_lock(ctl->mainloop);
|
||||
|
||||
|
|
@ -739,7 +739,7 @@ static int pipewire_ctl_poll_revents(snd_ctl_ext_t * ext, struct pollfd *pfd,
|
|||
assert(ctl);
|
||||
|
||||
if (!ctl->mainloop)
|
||||
return -EBADFD;
|
||||
return -EBADF;
|
||||
|
||||
pw_thread_loop_lock(ctl->mainloop);
|
||||
|
||||
|
|
|
|||
|
|
@ -586,7 +586,7 @@ static int device_write(struct impl *this, const void *data, uint32_t size)
|
|||
res = compress_offload_api_write(this->device_context, data, num_bytes_to_write);
|
||||
|
||||
if (SPA_UNLIKELY(res < 0)) {
|
||||
if (res == -EBADFD)
|
||||
if (res == -EBADF)
|
||||
spa_log_debug(this->log, "%p: device is paused", this);
|
||||
else
|
||||
spa_log_error(this->log, "%p: write error: %s", this, spa_strerror(res));
|
||||
|
|
|
|||
|
|
@ -254,8 +254,8 @@ int compress_offload_api_write(struct compress_offload_api_context *context, con
|
|||
num_bytes_written = write(context->fd, data, size);
|
||||
if (num_bytes_written < 0) {
|
||||
switch (errno) {
|
||||
case EBADFD:
|
||||
/* EBADFD indicates that the device is paused and thus is not an error. */
|
||||
case EBADF:
|
||||
/* EBADF indicates that the device is paused and thus is not an error. */
|
||||
break;
|
||||
default:
|
||||
spa_log_error(context->log, "could not write %zu byte(s): %s (%d)",
|
||||
|
|
|
|||
|
|
@ -107,9 +107,7 @@ static inline int res_to_err(int res)
|
|||
case -ENOKEY: return ERR_AUTHKEY;
|
||||
#endif
|
||||
case -ECONNRESET: case -EPIPE: return ERR_CONNECTIONTERMINATED;
|
||||
#ifdef EBADFD
|
||||
case -EBADFD: return ERR_BADSTATE;
|
||||
#endif
|
||||
case -EBADF: return ERR_BADSTATE;
|
||||
#ifdef ENODATA
|
||||
case -ENODATA: return ERR_NODATA;
|
||||
#endif
|
||||
|
|
@ -144,9 +142,7 @@ static inline int err_to_res(int err)
|
|||
case ERR_KILLED: return -EFAULT;
|
||||
case ERR_INVALIDSERVER: return -EINVAL;
|
||||
case ERR_MODINITFAILED: return -EIO;
|
||||
#ifdef EBADFD
|
||||
case ERR_BADSTATE: return -EBADFD;
|
||||
#endif
|
||||
case ERR_BADSTATE: return -EBADF;
|
||||
case ERR_NODATA: return -ENODATA;
|
||||
case ERR_VERSION: return -EPROTO;
|
||||
case ERR_TOOLARGE: return -E2BIG;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue