#include <unistd.h>
#include <sys/types.h>
#include <stdlib.h>
+#include <fcntl.h>
#include <sys/wait.h>
#include <errno.h>
int retval;
int count;
int status;
- int fds[2];
+ int fds[2], null_fd;
pid_t pid;
char *pos;
char arg[PROGRAM_SIZE];
close(STDOUT_FILENO);
/* dup write side of pipe to STDOUT */
- dup(fds[1]);
+ if (dup(fds[1]) < 0)
+ return -1;
+
+ /* Ignore writes to stderr */
+ null_fd = open("/dev/null", O_WRONLY);
+ if (null_fd > 0) {
+ close(STDERR_FILENO);
+ dup(null_fd);
+ close(null_fd);
+ }
retval = execv(argv[0], argv);
}
pp->state = checker_check(c);
condlog(3, "%s: state = %i", pp->dev, pp->state);
- if (pp->state == PATH_DOWN)
- condlog(2, "%s: checker msg is \"%s\"",
+ if (pp->state == PATH_DOWN && strlen(checker_message(c)))
+ condlog(3, "%s: checker msg is \"%s\"",
pp->dev, checker_message(c));
return 0;
}
}
pp->priority = prio_getprio(pp->prio, pp);
if (pp->priority < 0) {
- condlog(0, "%s: %s prio error", pp->dev, prio_name(pp->prio));
+ condlog(3, "%s: %s prio error", pp->dev, prio_name(pp->prio));
pp->priority = PRIO_UNDEF;
return 1;
}
condlog(0, "error formatting uid callout command");
memset(pp->wwid, 0, WWID_SIZE);
} else if (execute_program(buff, pp->wwid, WWID_SIZE)) {
- condlog(0, "error calling out %s", buff);
+ condlog(3, "error calling out %s", buff);
memset(pp->wwid, 0, WWID_SIZE);
return 1;
}
#define ALUA_PRIO_NOT_SUPPORTED 1
#define ALUA_PRIO_RTPG_FAILED 2
#define ALUA_PRIO_GETAAS_FAILED 3
+#define ALUA_PRIO_TPGS_FAILED 4
int
get_alua_info(int fd)
rc = get_target_port_group_support(fd);
if (rc < 0)
- return rc;
+ return -ALUA_PRIO_TPGS_FAILED;
if (rc == TPGS_NONE)
return -ALUA_PRIO_NOT_SUPPORTED;
case ALUA_PRIO_GETAAS_FAILED:
condlog(0, "%s: couln't get asymmetric access state", pp->dev);
break;
+ case ALUA_PRIO_TPGS_FAILED:
+ condlog(3, "%s: couln't get supported alua states", pp->dev);
+ break;
}
}
return rc;