capmt: coverity fixes
This commit is contained in:
parent
11eedbbd1e
commit
1fe84966a8
1 changed files with 6 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue