]> xenbits.xensource.com Git - libvirt.git/commitdiff
tools: delete vshStrdup
authorJán Tomko <jtomko@redhat.com>
Fri, 18 Oct 2019 13:54:06 +0000 (15:54 +0200)
committerJán Tomko <jtomko@redhat.com>
Sun, 20 Oct 2019 12:37:17 +0000 (14:37 +0200)
Now that we use g_strdup everywhere, delete vshStrdup.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
tools/vsh.c
tools/vsh.h

index baba5ec314a4013f27020dfd42defb419071ae92..a10a9625e4fa2d117e60fc43bc39fb759797aef7 100644 (file)
@@ -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)
 {
index 99977af7e3bd52cf5e845d4d505bb06a1a41f8fd..ad783e24b7e5f7fd203c1159071d6263c4dbaddb 100644 (file)
@@ -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: