Skip to content

Commit

Permalink
virtio-9p-proxy: improve error messages in connect_namedsocket()
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
  • Loading branch information
Michael Tokarev committed Nov 2, 2014
1 parent 6af76c6 commit 7d5a843
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hw/9pfs/virtio-9p-proxy.c
Expand Up @@ -1104,14 +1104,14 @@ static int connect_namedsocket(const char *path)

sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
if (sockfd < 0) {
fprintf(stderr, "socket %s\n", strerror(errno));
fprintf(stderr, "failed to create socket: %s\n", strerror(errno));
return -1;
}
strcpy(helper.sun_path, path);
helper.sun_family = AF_UNIX;
size = strlen(helper.sun_path) + sizeof(helper.sun_family);
if (connect(sockfd, (struct sockaddr *)&helper, size) < 0) {
fprintf(stderr, "socket error\n");
fprintf(stderr, "failed to connect to %s: %s\n", path, strerror(errno));
close(sockfd);
return -1;
}
Expand Down

0 comments on commit 7d5a843

Please sign in to comment.