diff options
author | Ján Tomko <jtomko@redhat.com> | 2019-10-20 13:49:46 +0200 |
---|---|---|
committer | Ján Tomko <jtomko@redhat.com> | 2019-10-21 12:51:59 +0200 |
commit | 29b1e859e31960fb3e923636f4e6d97c1b30f429 (patch) | |
tree | 9d952c2e0a17eb102e171fea1a3e0c502e456fa3 /tests/virhostdevtest.c | |
parent | ddb99ca51661e4b6411998506a3c4957e686a1f6 (diff) | |
download | libvirt-29b1e859e31960fb3e923636f4e6d97c1b30f429.tar.gz |
tests: use g_strdup instead of VIR_STRDUP
Replace all occurrences of
if (VIR_STRDUP(a, b) < 0)
/* effectively dead code */
with:
a = g_strdup(b);
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Diffstat (limited to 'tests/virhostdevtest.c')
-rw-r--r-- | tests/virhostdevtest.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/virhostdevtest.c b/tests/virhostdevtest.c index 8e21d3eae4..1f3f730433 100644 --- a/tests/virhostdevtest.c +++ b/tests/virhostdevtest.c @@ -117,8 +117,7 @@ myInit(void) goto cleanup; if ((mgr->activeSCSIHostdevs = virSCSIDeviceListNew()) == NULL) goto cleanup; - if (VIR_STRDUP(mgr->stateDir, TEST_STATE_DIR) < 0) - goto cleanup; + mgr->stateDir = g_strdup(TEST_STATE_DIR); if (virFileMakePath(mgr->stateDir) < 0) goto cleanup; @@ -501,10 +500,7 @@ mymain(void) int ret = 0; g_autofree char *fakerootdir = NULL; - if (VIR_STRDUP_QUIET(fakerootdir, FAKEROOTDIRTEMPLATE) < 0) { - fprintf(stderr, "Out of memory\n"); - abort(); - } + fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE); if (!mkdtemp(fakerootdir)) { fprintf(stderr, "Cannot create fakerootdir"); |