Changes in uspace/app/mkext4/mkext4.c [6ba36a0:4bb4cf88] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/mkext4/mkext4.c
r6ba36a0 r4bb4cf88 56 56 aoff64_t nblocks; 57 57 const char *label = ""; 58 unsigned int bsize = 4096; 58 59 59 60 cfg.version = ext4_def_fs_version; … … 68 69 ++argv; 69 70 70 while (*argv [0] == '-') {71 while (*argv && *argv[0] == '-') { 71 72 if (str_cmp(*argv, "--size") == 0) { 72 73 --argc; … … 87 88 --argc; 88 89 ++argv; 90 continue; 91 } 92 93 if (str_cmp(*argv, "--bsize") == 0) { 94 --argc; 95 ++argv; 96 if (*argv == NULL) { 97 printf(NAME ": Error, argument missing.\n"); 98 syntax_print(); 99 return 1; 100 } 101 102 bsize = strtol(*argv, &endptr, 10); 103 if (*endptr != '\0') { 104 printf(NAME ": Error, invalid argument.\n"); 105 syntax_print(); 106 return 1; 107 } 108 109 --argc; 110 ++argv; 111 continue; 89 112 } 90 113 … … 107 130 --argc; 108 131 ++argv; 132 continue; 109 133 } 110 134 … … 122 146 --argc; 123 147 ++argv; 148 continue; 149 } 150 151 if (str_cmp(*argv, "--help") == 0) { 152 syntax_print(); 153 return 0; 124 154 } 125 155 … … 128 158 ++argv; 129 159 break; 160 } else { 161 printf(NAME ": Invalid argument: %s\n", *argv); 162 syntax_print(); 163 return 1; 130 164 } 131 165 } … … 147 181 148 182 cfg.volume_name = label; 183 cfg.bsize = bsize; 149 184 (void) nblocks; 150 185 … … 166 201 "\t--size <sectors> Filesystem size, overrides device size\n" 167 202 "\t--label <label> Volume label\n" 168 "\t--type <fstype> Filesystem type (ext2, ext2old)\n"); 203 "\t--type <fstype> Filesystem type (ext2, ext2old)\n" 204 "\t--bsize <bytes> Filesystem block size in bytes (default = 4096)\n"); 169 205 } 170 206
Note:
See TracChangeset
for help on using the changeset viewer.