dvb: Handle socket() failure

CID #206178
This commit is contained in:
Edward Hervey 2014-04-16 15:32:32 +02:00
parent 012b5b8d4a
commit 1a42aaad47

View file

@ -83,7 +83,10 @@ cam_sw_client_open (CamSwClient * client, const char *sock_path)
strncpy (addr.sun_path, sock_path, sizeof (addr.sun_path));
GST_INFO ("connecting to softcam socket: %s", sock_path);
client->sock = socket (PF_UNIX, SOCK_STREAM, 0);
if (client->sock = socket (PF_UNIX, SOCK_STREAM, 0)) {
GST_ERROR ("Failed to create a socket, error : %s", strerror (errno));
return FALSE;
}
ret =
connect (client->sock, (struct sockaddr *) &addr,
sizeof (struct sockaddr_un));