while (--loop) {
fd = open(devpath, mode);
- if (fd > 0 || errno != ENOENT)
+ if (fd <= 0 && errno != ENOENT) {
+ condlog(3, "open error (%s)\n", strerror(errno));
+ return fd;
+ }
+ if (fd > 0)
return fd;
usleep(1000 * 1000 / WAIT_LOOP_PER_SECOND);
/*
* get path state, no message collection, no context
*/
- select_checkfn(pp);
-
if (mask & DI_CHECKER) {
+ if (!pp->checkfn)
+ select_checkfn(pp);
+
pp->state = pp->checkfn(pp->fd, NULL, NULL);
condlog(3, "state = %i", pp->state);
}
* get path prio
*/
if (mask & DI_PRIO) {
- select_getprio(pp);
+ if (!pp->getprio)
+ select_getprio(pp);
if (!pp->getprio) {
pp->priority = 1;
* get path uid
*/
if (mask & DI_WWID && !strlen(pp->wwid)) {
- select_getuid(pp);
+ if (!pp->getuid)
+ select_getuid(pp);
if (apply_format(pp->getuid, &buff[0], pp)) {
condlog(0, "error formatting uid callout command");
{
struct config * old = conf;
struct multipath * mpp;
+ struct path * pp;
int i;
conf = NULL;
mpp->mpe = find_mpe(mpp->wwid);
set_paths_owner(allpaths, mpp);
}
+ vector_foreach_slot (allpaths->pathvec, pp, i) {
+ select_checkfn(pp);
+ select_getuid(pp);
+ select_getprio(pp);
+ }
condlog(2, "reconfigured");
return 0;
}