From 471feca652bf86be7aa722565af70831678a89a1 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Wed, 3 Oct 2018 23:29:04 -0600 Subject: [PATCH] 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. --- nvme.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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, -- 2.50.1