From f5809464cd36c0bd7104a5580e25f17399126ac1 Mon Sep 17 00:00:00 2001 From: Owain Ainsworth Date: Wed, 4 May 2011 21:40:08 +0000 Subject: Switch atactl over to using opendev() instead of opendisk() so it can grok DUIDs now commands such as: # atactl b9b455bd99e393cd work as expected (while everything else that used to work still does). ok sthen@ --- sbin/atactl/atactl.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'sbin/atactl/atactl.c') diff --git a/sbin/atactl/atactl.c b/sbin/atactl/atactl.c index 25c25f4bdc7..aa5479bd773 100644 --- a/sbin/atactl/atactl.c +++ b/sbin/atactl/atactl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atactl.c,v 1.43 2011/04/06 11:36:25 miod Exp $ */ +/* $OpenBSD: atactl.c,v 1.44 2011/05/04 21:40:07 oga Exp $ */ /* $NetBSD: atactl.c,v 1.4 1999/02/24 18:49:14 jwise Exp $ */ /*- @@ -355,7 +355,6 @@ int main(int argc, char *argv[]) { struct command *cmdp; - char dvname_store[MAXPATHLEN]; if (argc < 2) usage(); @@ -363,23 +362,8 @@ main(int argc, char *argv[]) /* * Open the device */ - fd = opendisk(argv[1], O_RDWR, dvname_store, sizeof(dvname_store), 0); - if (fd == -1) { - if (errno == ENOENT) { - /* - * Device doesn't exist. Probably trying to open - * a device which doesn't use disk semantics for - * device name. Try again, specifying "cooked", - * which leaves off the "r" in front of the device's - * name. - */ - fd = opendisk(argv[1], O_RDWR, dvname_store, - sizeof(dvname_store), 1); - if (fd == -1) - err(1, "%s", argv[1]); - } else - err(1, "%s", argv[1]); - } + if ((fd = opendev(argv[1], O_RDWR, OPENDEV_PART, NULL)) == -1) + err(1, "%s", argv[1]); /* Skip program name and device name. */ if (argc != 2) { -- cgit v1.2.3