diff options
| author | gkostka <kostka.grzegorz@gmail.com> | 2015-12-31 01:12:20 +0100 |
|---|---|---|
| committer | gkostka <kostka.grzegorz@gmail.com> | 2015-12-31 01:12:20 +0100 |
| commit | 8dccafbc15132ad5ecff064a19d36d31d72b11c7 (patch) | |
| tree | 6362b52c1c02957dce06ce98f1b77c0e3945a371 | |
| parent | 58a418061b26a07e335a237af3882aba29d7ad4b (diff) | |
lwext4_server: improve opt list
| -rw-r--r-- | fs_test/lwext4_server.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/fs_test/lwext4_server.c b/fs_test/lwext4_server.c index 3658801..111b3a1 100644 --- a/fs_test/lwext4_server.c +++ b/fs_test/lwext4_server.c @@ -70,15 +70,15 @@ static int connection_port = 1234; static char *ext4_fname = "ext2"; /**@brief Verbose mode*/ -static int verbose = 0; +static bool verbose = false; /**@brief Winpart mode*/ -static int winpart = 0; +static bool winpart = false; /**@brief Blockdev handle*/ static struct ext4_blockdev *bd; -static int cache_wb = 0; +static bool cache_wb = false; static char read_buffer[MAX_RW_BUFFER]; static char write_buffer[MAX_RW_BUFFER]; @@ -299,12 +299,12 @@ static bool parse_opt(int argc, char **argv) static struct option long_options[] = { {"image", required_argument, 0, 'i'}, {"port", required_argument, 0, 'p'}, - {"verbose", required_argument, 0, 'v'}, - {"winpart", required_argument, 0, 'w'}, - {"cache_wb", required_argument, 0, 'c'}, + {"verbose", no_argument, 0, 'v'}, + {"winpart", no_argument, 0, 'w'}, + {"cache_wb", no_argument, 0, 'c'}, {0, 0, 0, 0}}; - while (-1 != (c = getopt_long(argc, argv, "c:i:p:v:w:", long_options, + while (-1 != (c = getopt_long(argc, argv, "i:p:vcw", long_options, &option_index))) { switch (c) { @@ -315,13 +315,13 @@ static bool parse_opt(int argc, char **argv) connection_port = atoi(optarg); break; case 'v': - verbose = atoi(optarg); + verbose = true; break; case 'c': - cache_wb = atoi(optarg); + cache_wb = true; break; case 'w': - winpart = atoi(optarg); + winpart = true; break; default: printf("%s", usage); @@ -411,6 +411,9 @@ int _mount(char *p) return -1; } + if (verbose) + ext4_dmask_set(DEBUG_ALL); + rc = ext4_mount(dev_name, mount_point); if (rc != EOK) return rc; |
