summaryrefslogtreecommitdiffstats
path: root/mdopen.c
diff options
context:
space:
mode:
authorMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>2023-03-23 17:50:15 +0100
committerJes Sorensen <jes@trained-monkey.org>2023-05-08 22:23:45 +0200
commit0f8347d4f6588ee6ded55af3e307418cee286a6f (patch)
tree4aebed93e4b352701fdf87ba194097c8e7a7e4a2 /mdopen.c
parentmdadm: define DEV_MD_DIR (diff)
downloadmdadm-0f8347d4f6588ee6ded55af3e307418cee286a6f.tar.xz
mdadm-0f8347d4f6588ee6ded55af3e307418cee286a6f.zip
mdadm: define DEV_NUM_PREF
Use define instead of inlines. Add _LEN define. Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
Diffstat (limited to 'mdopen.c')
-rw-r--r--mdopen.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mdopen.c b/mdopen.c
index 6c3bdb6a..d3022a54 100644
--- a/mdopen.c
+++ b/mdopen.c
@@ -412,11 +412,11 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
make_parts(devname, parts);
if (strcmp(chosen, devname) != 0) {
- if (mkdir("/dev/md",0700) == 0) {
- if (chown("/dev/md", ci->uid, ci->gid))
- perror("chown /dev/md");
- if (chmod("/dev/md", ci->mode| ((ci->mode>>2) & 0111)))
- perror("chmod /dev/md");
+ if (mkdir(DEV_NUM_PREF, 0700) == 0) {
+ if (chown(DEV_NUM_PREF, ci->uid, ci->gid))
+ perror("chown " DEV_NUM_PREF);
+ if (chmod(DEV_NUM_PREF, ci->mode | ((ci->mode >> 2) & 0111)))
+ perror("chmod " DEV_NUM_PREF);
}
if (dev && strcmp(chosen, dev) == 0)