kopia lustrzana https://github.com/Hamlib/Hamlib
Fix pipe NONBLOCK flags in iofunc.c -- was not being applied to both file descriptors
https://github.com/Hamlib/Hamlib/issues/902pull/910/head
rodzic
90400c0d9f
commit
ef77f1c71f
16
src/iofunc.c
16
src/iofunc.c
|
@ -108,7 +108,13 @@ int HAMLIB_API port_open(hamlib_port_t *p)
|
|||
flags |= O_NONBLOCK;
|
||||
if (fcntl(sync_pipe_fds[0], F_SETFL, flags))
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: error setting O_NONBLOCK on pipe=%s\n", __func__, strerror(errno));
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: error setting O_NONBLOCK on sync_read=%s\n", __func__, strerror(errno));
|
||||
}
|
||||
flags = fcntl(sync_pipe_fds[1], F_GETFL);
|
||||
flags |= O_NONBLOCK;
|
||||
if (fcntl(sync_pipe_fds[1], F_SETFL, flags))
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: error setting O_NONBLOCK on sync_write=%s\n", __func__, strerror(errno));
|
||||
}
|
||||
#endif
|
||||
if (status != 0)
|
||||
|
@ -131,7 +137,13 @@ int HAMLIB_API port_open(hamlib_port_t *p)
|
|||
flags |= O_NONBLOCK;
|
||||
if (fcntl(sync_pipe_fds[0], F_SETFL, flags))
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: error setting O_NONBLOCK on pipe#2=%s\n", __func__, strerror(errno));
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: error setting O_NONBLOCK on error_read=%s\n", __func__, strerror(errno));
|
||||
}
|
||||
flags = fcntl(sync_pipe_fds[1], F_GETFL);
|
||||
flags |= O_NONBLOCK;
|
||||
if (fcntl(sync_pipe_fds[1], F_SETFL, flags))
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: error setting O_NONBLOCK on error_write=%s\n", __func__, strerror(errno));
|
||||
}
|
||||
#endif
|
||||
if (status != 0)
|
||||
|
|
Ładowanie…
Reference in New Issue