makedevs: resync device creation with upstream busybox
authorArnout Vandecappelle <arnout@mind.be>
Sat, 5 Nov 2016 13:38:11 +0000 (14:38 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sat, 5 Nov 2016 22:32:46 +0000 (23:32 +0100)
commitab1b6f7df4355244dfc54b877889ff7a3cde02a0
tree8ca4f47f6e9b1c3286a9f4f85c7dad960080dd01
parentf55a63f95359da1edbfba1fbed26cf9d7c1bb897
makedevs: resync device creation with upstream busybox

In upstream busbyox, the code to create devices has been simplified:
the code for a single and for multiple devices is no longer duplicated.

Since we are going to change the device creation code next, it's
convenient to have only one copy to modify.

There are two behavioural changes with this, but they were introduced
silently together with other commits in upstream busybox.

- When mknod() fails, the chmod was still done. This is pointless so it
  is no longer done now.

- There was a check for mode != -1; however, a mode of -1 would not
  have worked anyway because all bits would be set for mknod(), which
  would fail. So this check is redundant.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tested-by: Fabio Estevam <festevam@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/makedevs/makedevs.c