ctl-client: Use EAGAIN instead of ENODATA
The latter is obsolete in POSIX.1-2008.srht-ci v0.6.1
parent
b1c1ade90d
commit
e710d47f2e
|
@ -223,7 +223,7 @@ static json_t* json_from_buffer(struct ctl_client* self)
|
||||||
{
|
{
|
||||||
if (self->read_len == 0) {
|
if (self->read_len == 0) {
|
||||||
DEBUG("Read buffer is empty");
|
DEBUG("Read buffer is empty");
|
||||||
errno = ENODATA;
|
errno = EAGAIN;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -238,7 +238,7 @@ static json_t* json_from_buffer(struct ctl_client* self)
|
||||||
errno = EMSGSIZE;
|
errno = EMSGSIZE;
|
||||||
} else {
|
} else {
|
||||||
DEBUG("Awaiting more data");
|
DEBUG("Awaiting more data");
|
||||||
errno = ENODATA;
|
errno = EAGAIN;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ERROR("Json parsing failed: %s", err.text);
|
ERROR("Json parsing failed: %s", err.text);
|
||||||
|
@ -252,7 +252,7 @@ static json_t* read_one_object(struct ctl_client* self, int timeout_ms)
|
||||||
json_t* root = json_from_buffer(self);
|
json_t* root = json_from_buffer(self);
|
||||||
if (root)
|
if (root)
|
||||||
return root;
|
return root;
|
||||||
if (errno != ENODATA)
|
if (errno != EAGAIN)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
struct pollfd pfd = {
|
struct pollfd pfd = {
|
||||||
|
@ -292,7 +292,7 @@ static json_t* read_one_object(struct ctl_client* self, int timeout_ms)
|
||||||
self->read_len += n;
|
self->read_len += n;
|
||||||
|
|
||||||
root = json_from_buffer(self);
|
root = json_from_buffer(self);
|
||||||
if (!root && errno != ENODATA)
|
if (!root && errno != EAGAIN)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return root;
|
return root;
|
||||||
|
|
Loading…
Reference in New Issue