When you went "losetup -d /dev/loop0 /dev/loop1" the error message was strange.
authorRob Landley <rob@landley.net>
Wed, 21 Dec 2005 17:00:25 +0000 (17:00 -0000)
committerRob Landley <rob@landley.net>
Wed, 21 Dec 2005 17:00:25 +0000 (17:00 -0000)
include/usage.h
util-linux/losetup.c

index 12c45b45f81f1f10e6674d41bcbcc4caa3ccfea3..9de9df8f39fa344d7e08642549b64673cd32a3d9 100644 (file)
        "\t-f\t\toutput data as the log grows"
 
 #define losetup_trivial_usage \
-       "[-od] LOOPDEVICE [FILE]\n"
+       "[-od] LOOPDEVICE [FILE]"
 #define losetup_full_usage \
        "Associate LOOPDEVICE with FILE, or display current association.\n\n" \
        "Options:\n" \
index b2af63dc0ea1c96a2960c4fbb8648b6aecfd4042..44721bd346f621d332b9cf80526215ca98310945 100644 (file)
@@ -33,7 +33,8 @@ int losetup_main (int argc, char **argv)
   switch(getopt(argc,argv, "do:")) {
     case 'd':
       /* detach takes exactly one argument */
-      if(optind+1==argc && !del_loop(argv[optind])) return EXIT_SUCCESS;
+      if(optind+1!=argc) bb_show_usage();
+      if(!del_loop(argv[optind])) return EXIT_SUCCESS;
 die_failed:
       bb_perror_msg_and_die("%s",argv[optind]);