Compare commits

..

No commits in common. "error-handling" and "master" have entirely different histories.

2 changed files with 4 additions and 5 deletions

View File

@ -444,8 +444,8 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
}
mdfd = open_dev_excl(devnm);
if (mdfd < 0)
pr_err("unexpected failure opening %s: %s\n",
devname, strerror(errno));
pr_err("unexpected failure opening %s\n",
devname);
return mdfd;
}

5
util.c
View File

@ -1088,9 +1088,8 @@ int open_dev_excl(char *devnm)
long delay = 1000;
sprintf(buf, "%d:%d", major(devid), minor(devid));
int fd = -1;
for (i = 0; i < 25; i++) {
fd = dev_open(buf, flags|O_EXCL);
int fd = dev_open(buf, flags|O_EXCL);
if (fd >= 0)
return fd;
if (errno == EACCES && flags == O_RDWR) {
@ -1103,7 +1102,7 @@ int open_dev_excl(char *devnm)
if (delay < 200000)
delay *= 2;
}
return fd;
return -1;
}
int same_dev(char *one, char *two)