]> xenbits.xensource.com Git - libvirt.git/commitdiff
vsh: remove namespace poisoning
authorJán Tomko <jtomko@redhat.com>
Mon, 20 Jun 2016 15:11:39 +0000 (17:11 +0200)
committerJán Tomko <jtomko@redhat.com>
Tue, 21 Jun 2016 16:07:25 +0000 (18:07 +0200)
We already have a syntax-check to prohibit direct use of these
allocation functions.

tools/vsh.c
tools/vsh.h

index 8649305b0cb0f678f47b064e40f04109fec14d31..2b7891918482babb6f289bcd754dc4f2ba61ac8c 100644 (file)
@@ -71,9 +71,6 @@
 const vshCmdGrp *cmdGroups;
 const vshCmdDef *cmdSet;
 
-/* Bypass header poison */
-#undef strdup
-
 
 /* simple handler for oom conditions */
 static void
@@ -164,9 +161,6 @@ _vshStrdup(vshControl *ctl, const char *s, const char *filename, int line)
     exit(EXIT_FAILURE);
 }
 
-/* Poison the raw allocating identifiers in favor of our vsh variants.  */
-#define strdup use_vshStrdup_instead_of_strdup
-
 int
 vshNameSorter(const void *a, const void *b)
 {
index f738a6f1182081ac3a9090aab6cec541c1d0f61a..8d6739724cb7e616c6d7bc621ef7fbb6985e79c9 100644 (file)
@@ -453,16 +453,6 @@ char *_vshStrdup(vshControl *ctl, const char *s, const char *filename,
                  int line);
 # define vshStrdup(_ctl, _s)    _vshStrdup(_ctl, _s, __FILE__, __LINE__)
 
-/* Poison the raw allocating identifiers in favor of our vsh variants.  */
-# undef malloc
-# undef calloc
-# undef realloc
-# undef strdup
-# define malloc use_vshMalloc_instead_of_malloc
-# define calloc use_vshCalloc_instead_of_calloc
-# define realloc use_vshRealloc_instead_of_realloc
-# define strdup use_vshStrdup_instead_of_strdup
-
 /* Macros to help dealing with mutually exclusive options. */
 
 /* VSH_EXCLUSIVE_OPTIONS_EXPR: