|
|
fgets(buf, sizeof(buf), fp); // read the output from the pipe into the buffer
|
|
fgets(buf, sizeof(buf), fp); // read the output from the pipe into the buffer
|
|
|
if (strlen(buf) > 0) { // if the output is non-empty, htop is running
|
|
if (strlen(buf) > 0) { // if the output is non-empty, htop is running
|