提交 f31bdc7c 编写于 作者: J Ján Tomko

tools: delete vshStrdup

Now that we use g_strdup everywhere, delete vshStrdup.
Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
上级 c937c1d2
......@@ -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)
{
......
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册