From 70869a3bdea792a5bbebb00b90dd3a4be1c9ff93 Mon Sep 17 00:00:00 2001 From: Turbo Fredriksson Date: Tue, 4 Jun 2013 03:55:28 +0200 Subject: [PATCH] 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 Issue #1498 --- cmd/zinject/translate.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/zinject/translate.c b/cmd/zinject/translate.c index fc1612738e11..b2ccb673a193 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); }