mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 10:41:26 +00:00
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:
@@ -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");
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user