info.array.working_disks++;
if (dnum < raiddisks)
info.array.active_disks++;
- fd = open(dname, O_RDONLY|O_EXCL, 0);
+ fd = open(dname, O_RDONLY|O_EXCL);
if (fd <0 ) {
fprintf(stderr, Name ": Cannot open %s: %s\n",
dname, strerror(errno));
info.disk.minor = 0;
info.disk.state = (1<<MD_DISK_FAULTY);
} else {
- fd = open(dv->devname, O_RDONLY|O_EXCL, 0);
+ fd = open(dv->devname, O_RDONLY|O_EXCL);
if (fd < 0) {
fprintf(stderr, Name ": failed to open %s after earlier success - aborting\n",
dv->devname);
* GET_ARRAY_INFO and GET_DISK_INFO ioctl calls
*/
- int fd = open(dev, O_RDONLY, 0);
+ int fd = open(dev, O_RDONLY);
int vers;
mdu_array_info_t array;
mdu_disk_info_t *disks;
}
spares = sra->array.spare_disks;
if (backup_file) {
- fdlist[d] = open(backup_file, O_RDWR|O_CREAT|O_EXCL, 0600);
+ fdlist[d] = open(backup_file, O_RDWR|O_CREAT|O_EXCL, S_IRUSR | S_IWUSR);
if (fdlist[d] < 0) {
fprintf(stderr, Name ": %s: cannot create backup file %s: %s\n",
devname, backup_file, strerror(errno));
return 1;
}
close(0);
- open("/dev/null", 3);
+ open("/dev/null", O_RDWR);
dup2(0,1);
dup2(0,2);
setsid();
* whether it is an md device and whether it has
* a superblock
*/
- int fd = open(dev, O_RDONLY, 0);
+ int fd = open(dev, O_RDONLY);
int vers;
int ioctlerr;
int superror, superrno;
/* from mdopen.c */
int open_mddev(char *dev, int autof/*unused */)
{
- int mdfd = open(dev, O_RDWR, 0);
+ int mdfd = open(dev, O_RDWR);
if (mdfd < 0)
fprintf(stderr, Name ": error opening %s: %s\n",
dev, strerror(errno));
must_remove = 1;
if (stb.st_mode && !must_remove) {
/* looks ok, see if it is available */
- mdfd = open(dev, O_RDWR, 0);
+ mdfd = open(dev, O_RDWR);
if (mdfd < 0) {
fprintf(stderr, Name ": error opening %s: %s\n",
dev, strerror(errno));
make_parts(dev,parts, ci->symlinks);
}
}
- mdfd = open(dev, O_RDWR, 0);
+ mdfd = open(dev, O_RDWR);
if (mdfd < 0)
fprintf(stderr, Name ": error opening %s: %s\n",
dev, strerror(errno));