Now if iSCSI daemon fails to load config file, it fails to load.

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@221 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2007-11-13 17:28:28 +00:00
parent 2de18c7c7a
commit ffb60ac8fc
2 changed files with 8 additions and 4 deletions

View File

@@ -624,7 +624,8 @@ int main(int argc, char **argv)
if (isns)
timeout = isns_init(isns, isns_ac);
cops->default_load(config);
if (cops->default_load(config) != 0)
exit(1);
if (gid && setgid(gid) < 0)
perror("setgid\n");

View File

@@ -100,7 +100,7 @@ static int plain_account_init(char *filename)
FILE *fp;
char buf[BUFSIZE], *p, *q;
u32 tid;
int idx;
int idx, res = 0;
if (!(fp = fopen(filename, "r")))
return -EIO;
@@ -122,14 +122,17 @@ static int plain_account_init(char *filename)
name = target_sep_string(&q);
pass = target_sep_string(&q);
if (cops->account_add(tid, idx, name, pass) < 0)
res = cops->account_add(tid, idx, name, pass);
if (res < 0) {
fprintf(stderr, "%s %s\n", name, pass);
break;
}
}
}
fclose(fp);
return 0;
return res;
}
/* Return the first account if the length of name is zero */