mdev: fix mode of creatred node if config file support is not configured
authorDenys Vlasenko <vda.linux@googlemail.com>
Sat, 21 Apr 2012 12:35:32 +0000 (14:35 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 21 Apr 2012 12:35:32 +0000 (14:35 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
util-linux/mdev.c

index 67de52d06b94969fd70f0cf9cc3690bd0f60efcb..0a34122b41d55d253c5aaa6237f24adf215e6be0 100644 (file)
@@ -164,7 +164,10 @@ struct globals {
        struct rule cur_rule;
 } FIX_ALIASING;
 #define G (*(struct globals*)&bb_common_bufsiz1)
-#define INIT_G() do { } while (0)
+#define INIT_G() do { \
+       IF_NOT_FEATURE_MDEV_CONF(G.cur_rule.maj = -1;) \
+       IF_NOT_FEATURE_MDEV_CONF(G.cur_rule.mode = 0660;) \
+} while (0)
 
 
 /* Prevent infinite loops in /sys symlinks */
@@ -477,9 +480,8 @@ static void make_device(char *path, int delete)
                        }
                }
                /* else: it's final implicit "match-all" rule */
-#endif
-
  rule_matches:
+#endif
                dbg("rule matched");
 
                /* Build alias name */