Librbd: fix return code of EventSocket init and notify

Signed-off-by: Haomai Wang <haomai@xsky.com>
This commit is contained in:
Haomai Wang 2015-11-07 15:54:53 +08:00
parent d19deacc01
commit c470e0bce3

View File

@ -36,7 +36,7 @@ class EventSocket {
return 0;
}
}
return -1;
return -EINVAL;
}
int notify() {
int ret;
@ -48,6 +48,8 @@ class EventSocket {
ret = write(socket, buf, 1);
if (ret < 0)
ret = -errno;
else
ret = 0;
}
case EVENT_SOCKET_TYPE_EVENTFD:
{
@ -55,6 +57,8 @@ class EventSocket {
ret = write(socket, &value, sizeof (value));
if (ret < 0)
ret = -errno;
else
ret = 0;
}
default:
{