summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2010-09-03 12:25:34 -0700
committerColin Cross <ccross@android.com>2010-09-03 12:27:01 -0700
commit17dcc5c57dcffb919f3de65ff7a0134ffa3bd874 (patch)
tree2431d225aa41272c4745353e39aeb9b5405cda81 /init
parentf74af26d1899fd85aa80dd65947dac89ef30a42c (diff)
downloadsystem_core-17dcc5c57dcffb919f3de65ff7a0134ffa3bd874.zip
system_core-17dcc5c57dcffb919f3de65ff7a0134ffa3bd874.tar.gz
system_core-17dcc5c57dcffb919f3de65ff7a0134ffa3bd874.tar.bz2
Use makedev helper for device major and minor numbers
Major and minor numbers can be greater than 255. Major numbers are 12 bits, and minor numbers are 20 bits. Supporting major and minor numbers > 255 allows the use of the extended block device for extra mmc partitions. Change-Id: I4c42bfe0781069e8e4cb13ebe26e860cdc03f866
Diffstat (limited to 'init')
-rw-r--r--init/devices.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/init/devices.c b/init/devices.c
index 8e912de..d7aa3a6 100644
--- a/init/devices.c
+++ b/init/devices.c
@@ -181,11 +181,8 @@ static void make_device(const char *path, int block, int major, int minor)
mode_t mode;
dev_t dev;
- if(major > 255 || minor > 255)
- return;
-
mode = get_device_perm(path, &uid, &gid) | (block ? S_IFBLK : S_IFCHR);
- dev = (major << 8) | minor;
+ dev = makedev(major, minor);
/* Temporarily change egid to avoid race condition setting the gid of the
* device node. Unforunately changing the euid would prevent creation of
* some device nodes, so the uid has to be set with chown() and is still