From f31bdc7ced695becdd6a090b23ab3e4f57b3a323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Fri, 18 Oct 2019 15:54:06 +0200 Subject: [PATCH] tools: delete vshStrdup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that we use g_strdup everywhere, delete vshStrdup. Signed-off-by: Ján Tomko Reviewed-by: Daniel Henrique Barboza --- tools/vsh.c | 12 ------------ tools/vsh.h | 4 ---- 2 files changed, 16 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index baba5ec314..a10a9625e4 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -142,18 +142,6 @@ _vshCalloc(vshControl *ctl, size_t nmemb, size_t size, const char *filename, exit(EXIT_FAILURE); } -char * -_vshStrdup(vshControl *ctl, const char *s, const char *filename, int line) -{ - char *x; - - if (VIR_STRDUP(x, s) >= 0) - return x; - vshError(ctl, _("%s: %d: failed to allocate %lu bytes"), - filename, line, (unsigned long)strlen(s)); - exit(EXIT_FAILURE); -} - int vshNameSorter(const void *a, const void *b) { diff --git a/tools/vsh.h b/tools/vsh.h index 99977af7e3..ad783e24b7 100644 --- a/tools/vsh.h +++ b/tools/vsh.h @@ -473,10 +473,6 @@ void *_vshCalloc(vshControl *ctl, size_t nmemb, size_t sz, #define vshCalloc(_ctl, _nmemb, _sz) \ _vshCalloc(_ctl, _nmemb, _sz, __FILE__, __LINE__) -char *_vshStrdup(vshControl *ctl, const char *s, const char *filename, - int line); -#define vshStrdup(_ctl, _s) _vshStrdup(_ctl, _s, __FILE__, __LINE__) - /* Macros to help dealing with mutually exclusive options. */ /* VSH_EXCLUSIVE_OPTIONS_EXPR: -- GitLab