File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -15,16 +15,21 @@ void printTitle(std::string title)
15
15
std::cout << std::setw (26 ) << std::left << title;
16
16
}
17
17
18
- int main (int /* argc*/ , char *argv[])
18
+ int main (int argc, char *argv[])
19
19
{
20
+ if (argc < 2 )
21
+ {
22
+ std::cerr << " Usage: " << argv[0 ] << " pollMs\n " ;
23
+ return -1 ;
24
+ }
20
25
PCMDaemon::Client client;
21
26
// client.setSharedMemoryIdLocation("/tmp/test-file");
22
27
client.connect ();
23
28
client.setPollInterval (atoi (argv[1 ]));
24
29
25
30
int coutPrecision = 2 ;
26
31
27
- while (true )
32
+ while (true )
28
33
{
29
34
PCMDaemon::SharedPCMState& state = client.read ();
30
35
PCMDaemon::SharedPCMCounters& counters = state.pcm ;
@@ -379,5 +384,5 @@ int main(int /*argc*/, char *argv[])
379
384
std::cout << std::flush;
380
385
}
381
386
382
- return 1 ;
387
+ return 0 ;
383
388
}
You can’t perform that action at this time.
0 commit comments