summaryrefslogtreecommitdiffstats
path: root/commands/filetype.c
diff options
context:
space:
mode:
Diffstat (limited to 'commands/filetype.c')
-rw-r--r--commands/filetype.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/commands/filetype.c b/commands/filetype.c
index 4e016dd4d6..7a556a980d 100644
--- a/commands/filetype.c
+++ b/commands/filetype.c
@@ -1,8 +1,5 @@
-/*
- * (C) Copyright 2012 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
- *
- * Under GPLv2 Only
- */
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: © 2012 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
#include <common.h>
#include <command.h>
@@ -69,7 +66,11 @@ static int do_filetype(int argc, char *argv[])
if (S_ISDIR(s.st_mode))
return -EISDIR;
- type = file_name_detect_type(filename);
+ ret = file_name_detect_type(filename, &type);
+ if (ret) {
+ printf("failed to detect type of %s: %s\n", filename, strerror(-ret));
+ return COMMAND_ERROR;
+ }
if (verbose)
printf("%s: %s (%s)\n", filename,