summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTurbo Fredriksson <[email protected]>2013-06-04 03:55:28 +0200
committerBrian Behlendorf <[email protected]>2013-08-15 10:09:09 -0700
commitf9e459d1435832caa69fdaf236ebaeacd93f1b3e (patch)
tree44603635a9d29ee1eee735346f812659373f0e07
parentfb5c53ea65b75c67c23f90ebbbb1134a5bb6c140 (diff)
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 <[email protected]> Issue #1498
-rw-r--r--cmd/zinject/translate.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/zinject/translate.c b/cmd/zinject/translate.c
index fc1612738..b2ccb673a 100644
--- a/cmd/zinject/translate.c
+++ b/cmd/zinject/translate.c
@@ -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);
}