Add support for a separate filesystem tag, and in the process improve the support...
[util-vserver.git] / src / vdevmap.c
index 4019c19..1a9c9a4 100644 (file)
@@ -85,6 +85,7 @@ int main(int argc, char *argv[])
   uint32_t     flags           = 0;
   char         *device         = NULL;
   char         *target         = NULL;
+  unsigned long        tmp             = 0;
   
   while (1) {
     int                c = getopt_long(argc, argv, "+x:ocrf:d:t:", CMDLINE_OPTIONS, 0);
@@ -100,12 +101,13 @@ int main(int argc, char *argv[])
       case 'd'         :  device = optarg;                     break;
       case 't'         :  target = optarg;                     break;
       case 'f'         :
-       if (!isNumberUnsigned(optarg, &flags, false)) {
+       if (!isNumberUnsigned(optarg, &tmp, false)) {
          WRITE_MSG(2, "Invalid flags argument: '");
          WRITE_STR(2, optarg);
          WRITE_MSG(2, "'; try '--help' for more information\n");
          return EXIT_FAILURE;
        }
+       flags |= (uint32_t) tmp;
        break;
 
       default          :
@@ -123,6 +125,8 @@ int main(int argc, char *argv[])
 
   if (xid==VC_NOCTX)
     WRITE_MSG(2, "No xid specified; try '--help' for more information\n");
+  else if (optind!=argc)
+    WRITE_MSG(2, "Unused argument(s); try '--help' for more information\n");
   else if (vc_set_mapping(xid, device, target, flags)==-1)
       perror("vc_set_mapping()");
   else