/* Blocking call */
new_fd = accept(sock, (struct sockaddr *) &sun, &len);
if (new_fd < 0) {
- PERROR("accept");
- return -errno;
+ if (errno != ECONNABORTED)
+ PERROR("accept");
+ new_fd = -errno;
+ if (new_fd == -ECONNABORTED)
+ new_fd = -EPIPE;
}
return new_fd;
}
if (errno != EPIPE && errno != ECONNRESET)
PERROR("recvmsg");
ret = -errno;
+ if (ret == -ECONNRESET)
+ ret = -EPIPE;
shutret = shutdown(sock, SHUT_RDWR);
if (shutret)
if (errno != EPIPE && errno != ECONNRESET)
PERROR("sendmsg");
ret = -errno;
+ if (ret == -ECONNRESET)
+ ret = -EPIPE;
shutret = shutdown(sock, SHUT_RDWR);
if (shutret)
if (errno != EPIPE && errno != ECONNRESET) {
PERROR("sendmsg");
}
+ ret = -errno;
+ if (ret == -ECONNRESET)
+ ret = -EPIPE;
}
return ret;
}
}
if (errno == EPIPE || errno == ECONNRESET)
ret = -errno;
+ if (ret == -ECONNRESET)
+ ret = -EPIPE;
goto end;
}
if (ret == 0) {
ret = ustcomm_send_unix_sock(sock, bytecode->data,
bytecode->len);
if (ret < 0) {
- if (ret == -ECONNRESET)
- fprintf(stderr, "remote end closed connection\n");
return ret;
}
if (ret != bytecode->len)
fields,
&chan->id,
&chan->header_type);
- if (ret)
+ if (ret) {
+ DBG("Error (%d) registering channel to sessiond", ret);
return ret;
+ }
}
CMM_ACCESS_ONCE(session->active) = 1;
uri,
&event->id);
if (ret < 0) {
+ DBG("Error (%d) registering event to sessiond", ret);
goto sessiond_register_error;
}
}