mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
vsh: remove vshErrorOOM
We abort on allocation errors now so there is no need to have a function for it. Replace the only use by return -1, chosen by fair dice roll. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
99114a6259
commit
997340588b
13
tools/vsh.c
13
tools/vsh.c
@ -64,17 +64,6 @@ const vshCmdGrp *cmdGroups;
|
|||||||
const vshCmdDef *cmdSet;
|
const vshCmdDef *cmdSet;
|
||||||
|
|
||||||
|
|
||||||
/* simple handler for oom conditions */
|
|
||||||
static void
|
|
||||||
vshErrorOOM(void)
|
|
||||||
{
|
|
||||||
fflush(stdout);
|
|
||||||
fputs(_("error: Out of memory\n"), stderr);
|
|
||||||
fflush(stderr);
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
double
|
double
|
||||||
vshPrettyCapacity(unsigned long long val, const char **unit)
|
vshPrettyCapacity(unsigned long long val, const char **unit)
|
||||||
{
|
{
|
||||||
@ -361,7 +350,7 @@ vshCmddefCheckInternals(vshControl *ctl,
|
|||||||
}
|
}
|
||||||
if ((p = strchr(name, '=')) &&
|
if ((p = strchr(name, '=')) &&
|
||||||
VIR_STRNDUP(name, name, p - name) < 0)
|
VIR_STRNDUP(name, name, p - name) < 0)
|
||||||
vshErrorOOM();
|
return -1;
|
||||||
for (j = i + 1; cmd->opts[j].name; j++) {
|
for (j = i + 1; cmd->opts[j].name; j++) {
|
||||||
if (STREQ(name, cmd->opts[j].name) &&
|
if (STREQ(name, cmd->opts[j].name) &&
|
||||||
cmd->opts[j].type != VSH_OT_ALIAS)
|
cmd->opts[j].type != VSH_OT_ALIAS)
|
||||||
|
Loading…
Reference in New Issue
Block a user