| 
      
      
      From: <abe...@us...> - 2016-11-28 15:04:20
      
     | 
| Revision: 7995
          http://sourceforge.net/p/astlinux/code/7995
Author:   abelbeck
Date:     2016-11-28 15:04:18 +0000 (Mon, 28 Nov 2016)
Log Message:
-----------
makedevs, revert cherry-picked upstream Buildroot fix, a part of r7935
Ref: https://git.buildroot.net/buildroot/commit/package?id=4c6d5e33ae1bdfc85c9734897c357a804bfd7435
Ref: http://lists.busybox.net/pipermail/buildroot/2016-November/177861.html
Revision Links:
--------------
    http://sourceforge.net/p/astlinux/code/7935
Modified Paths:
--------------
    branches/1.0/package/makedevs/makedevs.c
Modified: branches/1.0/package/makedevs/makedevs.c
===================================================================
--- branches/1.0/package/makedevs/makedevs.c	2016-11-28 14:09:47 UTC (rev 7994)
+++ branches/1.0/package/makedevs/makedevs.c	2016-11-28 15:04:18 UTC (rev 7995)
@@ -502,7 +502,6 @@
 			dev_t rdev;
 			unsigned i;
 			char *full_name_inc;
-			struct stat st;
 
 			if (type == 'p') {
 				mode |= S_IFIFO;
@@ -524,24 +523,10 @@
 			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);
-				mknod(full_name_inc, mode, rdev);       /* mknod required if using fakeroot */
-				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) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 |