Skip to content

Commit

Permalink
Minor touchups to new chkfs test
Browse files Browse the repository at this point in the history
Signed-off-by: Ralph Castain <[email protected]>
  • Loading branch information
rhc54 committed Dec 14, 2023
1 parent 5b5388b commit 585a358
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/chkfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ static int mountpoint(char *filename, char **fstype)
}

while (getmntent_r(fp, &mnt, buf, sizeof(buf))) {
fprintf(stderr, "MNT: %s %s\n", mnt.mnt_fsname, mnt.mnt_dir);
fd = open(mnt.mnt_dir, O_RDONLY);
if (0 > fd) {
// probably lack permissions
Expand Down Expand Up @@ -75,8 +74,12 @@ int main(int argc, char **argv)

for (n=1; NULL != argv[n]; n++) {
rc = mountpoint(argv[n], &fstype);
fprintf(stdout, "Return: %d File: %s FStype: %s\n", rc, argv[n], fstype);
free(fstype);
if (0 == rc) {
fprintf(stdout, "Return: %d File: %s FStype: %s\n", rc, argv[n], fstype);
free(fstype);
} else {
fprintf(stdout, "File: %s Unknown type\n", argv[n]);
}
}

return 0;
Expand Down

0 comments on commit 585a358

Please sign in to comment.