summaryrefslogtreecommitdiff
path: root/packages/mdev/mdev-1.2.1/mdevdelnodes.patch
diff options
context:
space:
mode:
authorMichael-Luke Jones <mlj28@cam.ac.uk>2006-09-25 08:50:58 +0000
committerMichael-Luke Jones <mlj28@cam.ac.uk>2006-09-25 08:50:58 +0000
commit0167cc200f1e1eb2553b9ba92042127ebcd48061 (patch)
tree539caf1b137080fe46d4862ffc3a8d3ddc509a54 /packages/mdev/mdev-1.2.1/mdevdelnodes.patch
parentaa36784ca33f26e61215d5dc6cba5acd5515b0d8 (diff)
busybox: remove mdev support
mdev: add separate mdev package creating standalone executable * adjust mdev.conf to create /dev/buzzer link * change slugos-image.bb to include standalone mdev
Diffstat (limited to 'packages/mdev/mdev-1.2.1/mdevdelnodes.patch')
-rw-r--r--packages/mdev/mdev-1.2.1/mdevdelnodes.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/packages/mdev/mdev-1.2.1/mdevdelnodes.patch b/packages/mdev/mdev-1.2.1/mdevdelnodes.patch
new file mode 100644
index 0000000000..b63a703a89
--- /dev/null
+++ b/packages/mdev/mdev-1.2.1/mdevdelnodes.patch
@@ -0,0 +1,39 @@
+Patch from Chris Steel to fix mdev deleting device nodes.
+
+--- busybox/util-linux/mdev.c 2006/08/03 15:41:12 15767
++++ busybox/util-linux/mdev.c 2006/08/10 01:09:37 15795
+@@ -37,18 +37,19 @@
+ * because sscanf() will stop at the first nondigit, which \n is. We
+ * also depend on path having writeable space after it. */
+
+- strcat(path, "/dev");
+- fd = open(path, O_RDONLY);
+- len = read(fd, temp + 1, 64);
+- *temp++ = 0;
+- close(fd);
+- if (len < 1) return;
++ if (!delete) {
++ strcat(path, "/dev");
++ fd = open(path, O_RDONLY);
++ len = read(fd, temp + 1, 64);
++ *temp++ = 0;
++ close(fd);
++ if (len < 1) return;
++ }
+
+ /* Determine device name, type, major and minor */
+
+ device_name = strrchr(path, '/') + 1;
+ type = path[5]=='c' ? S_IFCHR : S_IFBLK;
+- if (sscanf(temp, "%d:%d", &major, &minor) != 2) return;
+
+ /* If we have a config file, look up permissions for this device */
+
+@@ -164,6 +165,7 @@
+
+ umask(0);
+ if (!delete) {
++ if (sscanf(temp, "%d:%d", &major, &minor) != 2) return;
+ if (mknod(device_name, mode | type, makedev(major, minor)) && errno != EEXIST)
+ bb_perror_msg_and_die("mknod %s failed", device_name);
+