Skip to content

Commit

Permalink
Use setmntent() OR fopen()
Browse files Browse the repository at this point in the history
For the same reasons it's used in libzfs_init(), this was just
overlooked because zinject gets minimal use.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue openzfs#1498
  • Loading branch information
FransUrbo authored and unya committed Dec 13, 2013
1 parent b0abff1 commit 70869a3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/zinject/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ parse_pathname(const char *inpath, char *dataset, char *relpath,
return (-1);
}

#ifdef HAVE_SETMNTENT
if ((fp = setmntent(MNTTAB, "r")) == NULL) {
#else
if ((fp = fopen(MNTTAB, "r")) == NULL) {
#endif
(void) fprintf(stderr, "cannot open /etc/mtab\n");
return (-1);
}
Expand Down

0 comments on commit 70869a3

Please sign in to comment.