ipc: correctly shutdown IPC sockets when exiting/restarting

This commit is contained in:
Michael Stapelberg
2010-03-16 02:44:47 +01:00
parent fca826a6f9
commit f7a1a9fb20
5 changed files with 26 additions and 0 deletions

View File

@ -73,6 +73,8 @@ static void ipc_recv_message(int sockfd, uint32_t message_type,
int n = read(sockfd, msg + read_bytes, to_read);
if (n == -1)
err(EXIT_FAILURE, "read() failed");
if (n == 0)
errx(EXIT_FAILURE, "received EOF instead of reply");
read_bytes += n;
to_read -= n;