} else {
stb2 = stb;
}
- mknod(name, S_IFBLK | 0600, makedev(major, minor+i));
- chown(name, stb2.st_uid, stb2.st_gid);
- chmod(name, stb2.st_mode & 07777);
+ if (mknod(name, S_IFBLK | 0600, makedev(major, minor+i)))
+ perror("mknod");
+ if (chown(name, stb2.st_uid, stb2.st_gid))
+ perror("chown");
+ if (chmod(name, stb2.st_mode & 07777))
+ perror("chmod");
stat(name, &stb2);
add_dev(name, &stb2, 0, NULL);
}
major = get_mdp_major();
break;
case 0: /* not standard, pick an unused number */
- mdlist = mdstat_read(0);
+ mdlist = mdstat_read(0, 0);
for (num= (autof>0)?-1:0 ; ; num+= (autof>2)?-1:1) {
struct mdstat_ent *me;
for (me=mdlist; me; me=me->next)
minor = (-1-num) << MdpMinorShift;
else
minor = num;
- dn = map_dev(major,minor);
+ dn = map_dev(major,minor, 0);
if (dn==NULL || is_standard(dn, NULL)) {
/* this number only used by a 'standard' name,
* so it is safe to use
return -1;
}
if (must_remove) {
- chown(dev, stb.st_uid, stb.st_gid);
- chmod(dev, stb.st_mode & 07777);
+ if (chown(dev, stb.st_uid, stb.st_gid))
+ perror("chown");
+ if (chmod(dev, stb.st_mode & 07777))
+ perror("chmod");
}
stat(dev, &stb);
add_dev(dev, &stb, 0, NULL);