+Changes Prior to this release
+ - Fix embarassing bug which causes --add to always fail.
+
Changes Prior to 1.10.0 release
- Fix bug with --config=partitions
- Open sub-devices with O_EXCL to detect if already in use
mddev_dev_t dv;
struct stat stb;
int j;
+ int tfd;
int save_errno;
static char buf[4096];
case 'a':
/* add the device - hot or cold */
/* Make sure it isn' in use (in 2.6 or later) */
- fd = open(dv->devname, O_RDONLY|O_EXCL);
- if (fd < 0) {
+ tfd = open(dv->devname, O_RDONLY|O_EXCL);
+ if (tfd < 0) {
fprintf(stderr, Name ": Cannot open %s: %s\n",
dv->devname, strerror(errno));
return 1;
}
- close(fd);
+ close(tfd);
if (ioctl(fd, HOT_ADD_DISK, (unsigned long)stb.st_rdev)==0) {
fprintf(stderr, Name ": hot added %s\n",
dv->devname);