Report error is no message is read
authorJeremy Kerr <jk@ozlabs.org>
Sun, 4 Jan 2009 01:24:02 +0000 (10:24 +0900)
committerJeremy Kerr <jk@ozlabs.org>
Sun, 4 Jan 2009 01:24:02 +0000 (10:24 +0900)
Allow the client to detect read() failures.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
ui/common/discover-client.c

index 1901f6c5207e282cc8b754e79dcf67f4f4723d7f..bfd3acf1817206730a06b268c728ab970518db9c 100644 (file)
@@ -81,7 +81,7 @@ int discover_client_process(struct discover_client *client)
        message = pb_protocol_read_message(client, client->fd);
 
        if (!message)
-               return 0;
+               return -1;
 
        switch (message->action) {
        case PB_PROTOCOL_ACTION_ADD: