if (!(serial = sr_serial_dev_inst_new(conn, serialcomm)))
return NULL;
- if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK) {
+ if (serial_open(serial, SERIAL_RDWR) != SR_OK) {
sr_serial_dev_inst_free(serial);
return NULL;
}
if (!(serial = sr_serial_dev_inst_new(conn, serialcomm)))
return NULL;
- if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK)
+ if (serial_open(serial, SERIAL_RDWR) != SR_OK)
goto exit_err;
if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
devc->cmd_idx = 0;
create_cmd_14(devc->addr, 8, params, msg);
devc->req_sent_at = g_get_monotonic_time();
- if (serial_write_blocking(serial, msg, sizeof(msg)) < 0) {
+ if (serial_write_blocking(serial, msg, sizeof(msg)) == -1) {
return SR_ERR;
}
/* Write message and wait for reply */
devc->req_sent_at = g_get_monotonic_time();
- if (serial_write_blocking(serial, msg, sizeof(msg)) < 0) {
+ if (serial_write_blocking(serial, msg, sizeof(msg)) == -1) {
return SR_ERR;
}