aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/mdev.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2018-04-08 22:12:08 -0500
committerRob Landley <rob@landley.net>2018-04-08 22:12:08 -0500
commit221439164eb6683a5af35540b24b5620e5d8ab19 (patch)
tree5460bd0d03042863cb6b3ddf12a9473c84da8689 /toys/pending/mdev.c
parentcd3f81ebe5c82f1fd5f610b0f2e0fa07ac27903e (diff)
downloadtoybox-221439164eb6683a5af35540b24b5620e5d8ab19.tar.gz
Add mkpath() for common case of mkpathat(), and #define magic constants.
Diffstat (limited to 'toys/pending/mdev.c')
-rw-r--r--toys/pending/mdev.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/toys/pending/mdev.c b/toys/pending/mdev.c
index 9ee1f642..cab51e11 100644
--- a/toys/pending/mdev.c
+++ b/toys/pending/mdev.c
@@ -187,8 +187,7 @@ found_device:
return;
}
- if (strchr(device_name, '/'))
- mkpathat(AT_FDCWD, toybuf, 0, 2);
+ if (strchr(device_name, '/')) mkpath(toybuf);
if (mknod(toybuf, mode | type, dev_makedev(major, minor)) && errno != EEXIST)
perror_exit("mknod %s failed", toybuf);