diff options
author | Denys Vlasenko | 2010-08-16 14:26:15 +0200 |
---|---|---|
committer | Denys Vlasenko | 2010-08-16 14:26:15 +0200 |
commit | f2860bf6d332cbbfd2d4d9afadb0148cf061fad2 (patch) | |
tree | b62a8cac9da67d1cb2aa628665526f33c044f35b /util-linux | |
parent | 867ffb961672a226ba269b32c5d88a2c56b685fe (diff) | |
download | busybox-f2860bf6d332cbbfd2d4d9afadb0148cf061fad2.zip busybox-f2860bf6d332cbbfd2d4d9afadb0148cf061fad2.tar.gz |
mdev: fix non-working device deletion, add a test for that
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'util-linux')
-rw-r--r-- | util-linux/mdev.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/util-linux/mdev.c b/util-linux/mdev.c index b4042c0..cd6c1a8 100644 --- a/util-linux/mdev.c +++ b/util-linux/mdev.c @@ -132,6 +132,7 @@ static void make_device(char *path, int delete) major = -1; } } + /* else: for delete, -1 still deletes the node, but < -1 suppresses that */ /* Determine device name, type, major and minor */ device_name = (char*) bb_basename(path); @@ -279,7 +280,7 @@ static void make_device(char *path, int delete) if (aliaslink == '!' && s == a+1) { val = st; /* "!": suppress node creation/deletion */ - major = -1; + major = -2; } else if (aliaslink == '>' || aliaslink == '=') { val = st; @@ -379,7 +380,7 @@ static void make_device(char *path, int delete) free(command); } - if (delete && major >= 0) { + if (delete && major >= -1) { if (ENABLE_FEATURE_MDEV_RENAME && alias) { if (aliaslink == '>') unlink(device_name); |