Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
capmt: coverity fixes
  • Loading branch information
perexg committed Oct 3, 2014
1 parent 11eedbb commit 1fe8496
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/descrambler/capmt.c
Expand Up @@ -462,14 +462,17 @@ capmt_connect(capmt_t *capmt, int i)
"%s", capmt->capmt_sockfile);

fd = tvh_socket(AF_LOCAL, SOCK_STREAM, 0);
if (connect(fd, (const struct sockaddr*)&serv_addr_un,
if (fd < 0 ||
connect(fd, (const struct sockaddr*)&serv_addr_un,
sizeof(serv_addr_un)) != 0) {
if (tvheadend_running)
tvhlog(LOG_ERR, "capmt",
"%s: Cannot connect to %s (%s); Do you have OSCam running?",
capmt_name(capmt), capmt->capmt_sockfile, strerror(errno));
close(fd);
fd = -1;
if (fd >= 0) {
close(fd);
fd = -1;
}
}

}
Expand Down

0 comments on commit 1fe8496

Please sign in to comment.