mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
virsh: getSignalNumber: use g_strdup
Eliminate the use of vshStrdup. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
5c808a09a7
commit
fc941b2c54
@ -8802,11 +8802,11 @@ VIR_ENUM_IMPL(virDomainProcessSignal,
|
||||
"rt23", "rt24", "rt25", "rt26", "rt27", /* 55-59 */
|
||||
"rt28", "rt29", "rt30", "rt31", "rt32"); /* 60-64 */
|
||||
|
||||
static int getSignalNumber(vshControl *ctl, const char *signame)
|
||||
static int getSignalNumber(const char *signame)
|
||||
{
|
||||
size_t i;
|
||||
int signum;
|
||||
g_autofree char *str = vshStrdup(ctl, signame);
|
||||
g_autofree char *str = g_strdup(signame);
|
||||
char *p = str;
|
||||
|
||||
for (i = 0; signame[i]; i++)
|
||||
@ -8840,7 +8840,7 @@ cmdSendProcessSignal(vshControl *ctl, const vshCmd *cmd)
|
||||
if (vshCommandOptStringReq(ctl, cmd, "signame", &signame) < 0)
|
||||
return false;
|
||||
|
||||
if ((signum = getSignalNumber(ctl, signame)) < 0) {
|
||||
if ((signum = getSignalNumber(signame)) < 0) {
|
||||
vshError(ctl, _("malformed signal name: %s"), signame);
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user