Skip to content

Commit

Permalink
Fix build issue (ignore unused result)
Browse files Browse the repository at this point in the history
  • Loading branch information
githubbie committed Feb 27, 2024
1 parent dbb56c2 commit 1fd0883
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions cgroups.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,10 @@ walkcgroup(char *dirname, struct cgchainer *cparent, int parentseq,

closedir(dirp);

chdir("..");
// return to original directory
//
if ( chdir("..") == -1)
return -1;

ccp->cstat->gen.procsbelow = procsbelow;

Expand Down Expand Up @@ -671,15 +674,16 @@ gettotpressure(char *fname)

if ( (fp = fopen(fname, "r")) != NULL)
{
fgets(linebuf, sizeof(linebuf), fp); // skip 'some' line

// only handle second line: 'total' pressure
//
if ( fgets(linebuf, sizeof(linebuf), fp) != NULL)
if ( fgets(linebuf, sizeof(linebuf), fp) != NULL) // skip 'some' line
{
sscanf(linebuf, psiformat,
&psitype, &a10, &a60, &a300, &totpressure);
}
// only handle second line: 'total' pressure
//
if ( fgets(linebuf, sizeof(linebuf), fp) != NULL)
{
sscanf(linebuf, psiformat,
&psitype, &a10, &a60, &a300, &totpressure);
}
}

fclose(fp);
}
Expand Down

0 comments on commit 1fd0883

Please sign in to comment.