diff options
author | Lee Duncan <lduncan@suse.com> | 2021-11-19 08:18:50 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-19 08:18:50 -0800 |
commit | a2158a7bb73950cc378a99df45fb2e504dab0d90 (patch) | |
tree | 00c306cc3e68e1fcbe2a35b12174dbefb3b5a187 | |
parent | 3d764276420a69a551c30cd34d8560c971b5ebce (diff) | |
parent | 6c54bf1ee7cd3f31cd0f55459809e739fe9a85de (diff) | |
download | open-iscsi-a2158a7bb73950cc378a99df45fb2e504dab0d90.tar.gz |
Merge pull request #287 from wenchao-hao/fix_seg
iscsiadm: Call log_init() first to fix a segmentation fault
-rw-r--r-- | usr/iscsiadm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c index 192da66..0467db5 100644 --- a/usr/iscsiadm.c +++ b/usr/iscsiadm.c @@ -3599,6 +3599,9 @@ main(int argc, char **argv) struct iscsi_session *se = NULL; bool wait = true; + /* enable stdout logging */ + log_init(program_name, 1024, log_do_log_std, NULL); + ctx = iscsi_context_new(); if (ctx == NULL) { log_error("No memory"); @@ -3616,8 +3619,6 @@ main(int argc, char **argv) umask(0077); - /* enable stdout logging */ - log_init(program_name, 1024, log_do_log_std, NULL); sysfs_init(); optopt = 0; |