]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
depmod: add missing "else" clause
authorJan Engelhardt <jengelh@inai.de>
Wed, 7 Aug 2013 21:58:58 +0000 (23:58 +0200)
committerLucas De Marchi <lucas.demarchi@intel.com>
Fri, 9 Aug 2013 15:01:10 +0000 (12:01 -0300)
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.

libkmod/libkmod-config.c
tools/depmod.c

index 201c349d91c620242b0cb1f861497b381c3d1428..cb4cf61e92ce71d950536f633d0b92640226b3f6 100644 (file)
@@ -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;
index 4a02631330ce780ff811f35163b1de8bdf248bb9..985cf3ae001a9c17dcb9c7475bafaaed4d4a6d54 100644 (file)
@@ -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;
        }