summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgreg@kroah.com <greg@kroah.com>2003-12-03 17:41:02 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:13:05 -0700
commit8957102244524980f5008dcaf4cbf271a5254531 (patch)
tree5d700d055a0c40664b92b4c99587bd08c85a3084
parent356816abf60ca6a36d4e10e8ccd33fa9b1cd10a1 (diff)
[PATCH] add support for the default_mode variable, as it is documented...
-rw-r--r--namedev.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/namedev.c b/namedev.c
index b9e099413b..f4c263f5bc 100644
--- a/namedev.c
+++ b/namedev.c
@@ -138,8 +138,12 @@ int add_config_dev(struct config_device *new_dev)
static mode_t get_default_mode(struct sysfs_class_device *class_dev)
{
- /* just default everyone to rw for the world! */
- return 0666;
+ mode_t mode = 0600; /* default to owner rw only */
+
+ if (strlen(default_mode_str) != 0) {
+ mode = strtol(default_mode_str, NULL, 8);
+ }
+ return mode;
}
static void build_kernel_number(struct sysfs_class_device *class_dev, struct udevice *udev)