int Monitor(mddev_dev_t devlist,
char *mailaddr, char *alert_cmd,
int period, int daemonise, int scan, int oneshot,
- int dosyslog, char *config, int test, char* pidfile)
+ int dosyslog, int test, char* pidfile)
{
/*
* Every few seconds, scan every md device looking for changes
char *mailfrom = NULL;
if (!mailaddr) {
- mailaddr = conf_get_mailaddr(config);
+ mailaddr = conf_get_mailaddr();
if (mailaddr && ! scan)
fprintf(stderr, Name ": Monitor using email address \"%s\" from config file\n",
mailaddr);
}
- mailfrom = conf_get_mailfrom(config);
+ mailfrom = conf_get_mailfrom();
if (!alert_cmd) {
- alert_cmd = conf_get_program(config);
+ alert_cmd = conf_get_program();
if (alert_cmd && ! scan)
fprintf(stderr, Name ": Monitor using program \"%s\" from config file\n",
alert_cmd);
}
if (devlist == NULL) {
- mddev_ident_t mdlist = conf_get_ident(config, NULL);
+ mddev_ident_t mdlist = conf_get_ident(NULL);
for (; mdlist; mdlist=mdlist->next) {
struct state *st = malloc(sizeof *st);
if (st == NULL)
} else {
mddev_dev_t dv;
for (dv=devlist ; dv; dv=dv->next) {
- mddev_ident_t mdlist = conf_get_ident(config, dv->devname);
+ mddev_ident_t mdlist = conf_get_ident(dv->devname);
struct state *st = malloc(sizeof *st);
if (st == NULL)
continue;
ioctl(fd, GET_ARRAY_INFO, &array)< 0) {
/* no such array */
if (fd >=0) close(fd);
+ put_md_name(st->devname);
free(st->devname);
free(st);
- put_md_name(st->devname);
continue;
}
close(fd);
if (mdstat) {
char buf[8192];
int n;
- fprintf(mp, "\nP.S. The /proc/mdstat file current contains the following:\n\n");
+ fprintf(mp, "\nP.S. The /proc/mdstat file currently contains the following:\n\n");
while ( (n=fread(buf, 1, sizeof(buf), mdstat)) > 0)
n=fwrite(buf, 1, n, mp); /* yes, i don't care about the result */
fclose(mdstat);