summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@inai.de>2013-08-07 23:58:58 +0200
committerLucas De Marchi <lucas.demarchi@intel.com>2013-08-09 12:01:10 -0300
commitc1170883b4b42eadaddf951b3334286c6dfdf6e5 (patch)
tree90669d6ff5a971dbb38ceb0a1472e300fa548da7
parent48a409644199d5efff6d966cd72ccc7f5a06c2a5 (diff)
downloadkmod-c1170883b4b42eadaddf951b3334286c6dfdf6e5.tar.gz
depmod: add missing "else" clause
It occurred to an openSUSE user that our mkinitrd would throw a warning when used with kmod: libkmod: conf_files_list: unsupported file mode /dev/null: 0x21b6 Grepping for the error message revealed that there might be a missing "else" keyword here, since it is unusual to put an "if" directly after closing brace.
-rw-r--r--libkmod/libkmod-config.c2
-rw-r--r--tools/depmod.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c
index 201c349..cb4cf61 100644
--- a/libkmod/libkmod-config.c
+++ b/libkmod/libkmod-config.c
@@ -833,7 +833,7 @@ static int conf_files_list(struct kmod_ctx *ctx, struct kmod_list **list,
if (S_ISREG(st.st_mode)) {
conf_files_insert_sorted(ctx, list, path, NULL);
return 0;
- } if (!S_ISDIR(st.st_mode)) {
+ } else if (!S_ISDIR(st.st_mode)) {
ERR(ctx, "unsupported file mode %s: %#x\n",
path, st.st_mode);
return -EINVAL;
diff --git a/tools/depmod.c b/tools/depmod.c
index 4a02631..985cf3a 100644
--- a/tools/depmod.c
+++ b/tools/depmod.c
@@ -848,7 +848,7 @@ static int cfg_files_list(struct cfg_file ***p_files, size_t *p_n_files,
if (S_ISREG(st.st_mode)) {
cfg_files_insert_sorted(p_files, p_n_files, path, NULL);
return 0;
- } if (!S_ISDIR(st.st_mode)) {
+ } else if (!S_ISDIR(st.st_mode)) {
ERR("unsupported file mode %s: %#x\n", path, st.st_mode);
return -EINVAL;
}