Skip to content

Commit

Permalink
Fix stat() call
Browse files Browse the repository at this point in the history
  • Loading branch information
repojohnray committed May 19, 2020
1 parent f7369c9 commit 083438d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions device.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ cIptvDevice::cIptvDevice(unsigned int indexP)
// Check if dvr fifo exists
struct stat sb;
cString filename = cString::sprintf(IPTV_DVR_FILENAME, deviceIndexM);
stat(filename, &sb);
if (S_ISFIFO(sb.st_mode)) {
dvrFdM = open(filename, O_RDWR | O_NONBLOCK);
if (dvrFdM >= 0)
info("IPTV device %d redirecting input stream to '%s'", deviceIndexM, *filename);
if (stat(filename, &sb) == 0) {
if (S_ISFIFO(sb.st_mode)) {
dvrFdM = open(filename, O_RDWR | O_NONBLOCK);
if (dvrFdM >= 0)
info("IPTV device %d redirecting input stream to '%s'", deviceIndexM, *filename);
}
}
}

cIptvDevice::~cIptvDevice()
Expand Down

0 comments on commit 083438d

Please sign in to comment.