Skip to content

Commit

Permalink
Convert to std::array and std::string. (misc polling)
Browse files Browse the repository at this point in the history
This load average case wasn't consolidated with the others because the
file it is in doesn't include any myth specific headers.
  • Loading branch information
linuxdude42 committed Aug 28, 2020
1 parent 86a2b8a commit 54b4dd0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions mythtv/programs/mythexternrecorder/MythExternControl.cpp
Expand Up @@ -440,8 +440,7 @@ void Commands::Run(void)

QString cmd;

struct pollfd polls[2];
memset(polls, 0, sizeof(polls));
std::array<struct pollfd,2> polls {};

polls[0].fd = 0;
polls[0].events = POLLIN | POLLPRI;
Expand All @@ -457,7 +456,7 @@ void Commands::Run(void)
{
int timeout = 250;
int poll_cnt = 1;
int ret = poll(polls, poll_cnt, timeout);
int ret = poll(polls.data(), poll_cnt, timeout);

if (polls[0].revents & POLLHUP)
{
Expand Down
5 changes: 2 additions & 3 deletions mythtv/programs/mythfilerecorder/mythfilerecorder.cpp
Expand Up @@ -313,8 +313,7 @@ bool Commands::Run(const QString & filename, int data_rate, bool loopinput)
QString cmd;

int poll_cnt = 1;
struct pollfd polls[2];
memset(polls, 0, sizeof(polls));
std::array<struct pollfd,2> polls {};

polls[0].fd = 0;
polls[0].events = POLLIN | POLLPRI;
Expand Down Expand Up @@ -342,7 +341,7 @@ bool Commands::Run(const QString & filename, int data_rate, bool loopinput)

while (m_run)
{
int ret = poll(polls, poll_cnt, m_timeout);
int ret = poll(polls.data(), poll_cnt, m_timeout);

if (polls[0].revents & POLLHUP)
{
Expand Down

0 comments on commit 54b4dd0

Please sign in to comment.