dschedctl: Allow /dev/<disk> as valid syntax
authorStathis Kamperis <beket@dragonflybsd.org>
Wed, 21 Apr 2010 22:41:23 +0000 (01:41 +0300)
committerStathis Kamperis <beket@dragonflybsd.org>
Wed, 21 Apr 2010 22:44:19 +0000 (01:44 +0300)
Discussed-with: alexh@

usr.sbin/dschedctl/dschedctl.c

index 918a473..8aa0192 100644 (file)
@@ -149,7 +149,11 @@ int main(int argc, char *argv[])
 
        if (argc == 1) {
                dflag = 1;
-               disk_name = argv[0];
+               if (strncmp(argv[0], "/dev/", 5) == 0) {
+                 disk_name = argv[0] + 5;
+               } else {
+                       disk_name = argv[0];
+               }
        } else if (argc > 1) {
                usage();
                /* NOT REACHED */