From 781106ffe65e478ba68355d49510cc445d902901 Mon Sep 17 00:00:00 2001 From: jdc Date: Wed, 23 Feb 2000 11:33:58 +0000 Subject: [PATCH] Make sure that the control device can be opened. --- usr.sbin/tadpolectl/tadpolectl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr.sbin/tadpolectl/tadpolectl.c b/usr.sbin/tadpolectl/tadpolectl.c index be22c50c40c1..63afbb2cfff1 100644 --- a/usr.sbin/tadpolectl/tadpolectl.c +++ b/usr.sbin/tadpolectl/tadpolectl.c @@ -1,4 +1,4 @@ -/* $NetBSD: tadpolectl.c,v 1.2 1999/12/20 09:51:53 jdc Exp $ */ +/* $NetBSD: tadpolectl.c,v 1.3 2000/02/23 11:33:58 jdc Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -49,6 +49,8 @@ #include #include +#define TCTRL_DEV "/dev/tctrl0" + int aflag, nflag, wflag, dev; #define PROTO(x) int x __P((int, int, int)); @@ -747,7 +749,8 @@ main(argc, argv) argc -= optind; argv += optind; - dev = open("/dev/tctrl0", O_RDONLY, NULL); + if ((dev = open(TCTRL_DEV, O_RDONLY, NULL)) == -1) + err(1, "%s", TCTRL_DEV); if (aflag) { for (j=0; j < NUM_MIBS; j++) {