diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2017-04-27 18:02:35 +0100 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2017-04-27 18:02:35 +0100 |
commit | b1a0db7ac5debbfb222e990c48253c1490ab1225 (patch) | |
tree | bfab25bd60f3089d47d66bd560d38c6046814f25 /osinfo/osinfo_loader.c | |
parent | 7b671dcce5e9ecbad9a051346d6909a7f21ba132 (diff) | |
download | libosinfo-b1a0db7ac5debbfb222e990c48253c1490ab1225.tar.gz |
Fix error propagation in DB loader
When failing to read the pci/usb ID files we failed to
propagate the reported error.
We also had some dead code which would never be reached
due to earlier gotos.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'osinfo/osinfo_loader.c')
-rw-r--r-- | osinfo/osinfo_loader.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c index 6c7c009..dca23f1 100644 --- a/osinfo/osinfo_loader.c +++ b/osinfo/osinfo_loader.c @@ -2127,9 +2127,6 @@ static void osinfo_loader_process_list(OsinfoLoader *loader, tmp++; } - if (lerr) - goto cleanup; - /* Phase 2: load data from non-native locations, filtering based * on overrides from native locations */ tmp = dirs; @@ -2151,15 +2148,13 @@ static void osinfo_loader_process_list(OsinfoLoader *loader, } if (lerr) { - break; + g_propagate_error(err, lerr); + goto cleanup; } tmp++; } - if (lerr) - goto cleanup; - /* Phase 3: load combined set of files from native locations */ g_hash_table_iter_init(&iter, allentries); while (g_hash_table_iter_next(&iter, &key, &value)) { |