aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sbin/mdconfig/mdconfig.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c
index b23e903831aba..d83148dc1d70d 100644
--- a/sbin/mdconfig/mdconfig.c
+++ b/sbin/mdconfig/mdconfig.c
@@ -113,6 +113,10 @@ main(int argc, char **argv)
cmdline = 2;
}
mdio.md_file = optarg;
+ fd = open(optarg, O_RDONLY);
+ if (fd < 0)
+ err(1, "could not open %s", optarg);
+ close(fd);
break;
case 'o':
if (cmdline != 2)