aboutsummaryrefslogtreecommitdiff
path: root/package/makedevs
diff options
context:
space:
mode:
authorGravatar Peter Korsgaard <peter@korsgaard.com>2016-11-27 20:33:50 +0100
committerGravatar Peter Korsgaard <peter@korsgaard.com>2016-11-27 21:12:24 +0100
commit4c6d5e33ae1bdfc85c9734897c357a804bfd7435 (patch)
tree78cce605002c00ad9c8de4cb4d4303eaae31694f /package/makedevs
parentca41a78c2dcbb9874c0d4c285eb10e3ba1633ee1 (diff)
downloadbuildroot-4c6d5e33ae1bdfc85c9734897c357a804bfd7435.tar.gz
buildroot-4c6d5e33ae1bdfc85c9734897c357a804bfd7435.tar.bz2
Revert "makedevs: make device node creation idempotent"
This reverts commit c85cd189dc1ded92b78c5968860ff447ec9815ad. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'package/makedevs')
-rw-r--r--package/makedevs/makedevs.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/package/makedevs/makedevs.c b/package/makedevs/makedevs.c
index bcf0e0f000..7092b1475e 100644
--- a/package/makedevs/makedevs.c
+++ b/package/makedevs/makedevs.c
@@ -601,7 +601,6 @@ int main(int argc, char **argv)
dev_t rdev;
unsigned i;
char *full_name_inc;
- struct stat st;
if (type == 'p') {
mode |= S_IFIFO;
@@ -623,23 +622,10 @@ int main(int argc, char **argv)
for (i = start; i <= start + count; i++) {
sprintf(full_name_inc, count ? "%s%u" : "%s", full_name, i);
rdev = makedev(major, minor + (i - start) * increment);
- if (stat(full_name_inc, &st) == 0) {
- if ((mode & S_IFMT) != (st.st_mode & S_IFMT)) {
- bb_error_msg("line %d: node %s exists but is of wrong file type", linenum, full_name_inc);
- ret = EXIT_FAILURE;
- continue;
- }
- if (st.st_rdev != rdev) {
- bb_error_msg("line %d: node %s exists but is wrong device number", linenum, full_name_inc);
- ret = EXIT_FAILURE;
- continue;
- }
- } else if (mknod(full_name_inc, mode, rdev) < 0) {
+ if (mknod(full_name_inc, mode, rdev) < 0) {
bb_perror_msg("line %d: can't create node %s", linenum, full_name_inc);
ret = EXIT_FAILURE;
- continue;
- }
- if (chown(full_name_inc, uid, gid) < 0) {
+ } else if (chown(full_name_inc, uid, gid) < 0) {
bb_perror_msg("line %d: can't chown %s", linenum, full_name_inc);
ret = EXIT_FAILURE;
} else if (chmod(full_name_inc, mode) < 0) {