[PATCH 4/4] depmod: Add error message for bad version
From: Laura Abbott <hidden>
Date: 2015-09-11 20:56:00
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Laura Abbott <hidden>
Date: 2015-09-11 20:56:00
Subsystem:
the rest · Maintainer:
Linus Torvalds
Currently, if a value that doesn't match a kernel version
("%u.%u") is passed in, depmod silently falls back to
using uname. Make it clear to the user that this is happening
by giving a message to the user.
---
tools/depmod.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/depmod.c b/tools/depmod.c
index 30f6191..f491542 100644
--- a/tools/depmod.c
+++ b/tools/depmod.c@@ -2480,6 +2480,11 @@ static int do_depmod(int argc, char *argv[]) cfg.kversion = argv[optind]; optind++; } else { + if (optind < argc) { + ERR("Bad version passed %s\n", argv[optind]); + ERR("Falling back to uname\n"); + } + if (uname(&un) < 0) { CRIT("uname() failed: %s\n", strerror(errno)); goto cmdline_failed;
--
2.4.3