From: Warner Losh Date: Thu, 4 Oct 2018 05:29:04 +0000 (-0600) Subject: Include libgen.h for basename prototype. X-Git-Tag: v1.7~46^2~6 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=471feca652bf86be7aa722565af70831678a89a1;p=users%2Fsagi%2Fnvme-cli.git Include libgen.h for basename prototype. Also, convert open_dev to take a char * and remove the cast from where it's called. basenmae takes a char * and modifies the string. In this case, such modifications are fine and only the const char * type was in error. --- diff --git a/nvme.c b/nvme.c index a239322a..e2f4abc9 100644 --- a/nvme.c +++ b/nvme.c @@ -36,6 +36,7 @@ #include #include #include +#include #include @@ -92,7 +93,7 @@ static unsigned long long elapsed_utime(struct timeval start_time, return ret; } -static int open_dev(const char *dev) +static int open_dev(char *dev) { int err, fd; @@ -133,7 +134,7 @@ static int get_dev(int argc, char **argv) if (ret) return ret; - return open_dev((const char *)argv[optind]); + return open_dev(argv[optind]); } int parse_and_open(int argc, char **argv, const char *desc,