Use setmntent() OR fopen()
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 #1498
This commit is contained in:
parent
fb5c53ea65
commit
f9e459d143
|
@ -115,7 +115,11 @@ parse_pathname(const char *inpath, char *dataset, char *relpath,
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_SETMNTENT
|
||||||
|
if ((fp = setmntent(MNTTAB, "r")) == NULL) {
|
||||||
|
#else
|
||||||
if ((fp = fopen(MNTTAB, "r")) == NULL) {
|
if ((fp = fopen(MNTTAB, "r")) == NULL) {
|
||||||
|
#endif
|
||||||
(void) fprintf(stderr, "cannot open /etc/mtab\n");
|
(void) fprintf(stderr, "cannot open /etc/mtab\n");
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue