]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vsh: remove vshErrorOOM
authorJán Tomko <jtomko@redhat.com>
Wed, 11 Dec 2019 12:48:32 +0000 (13:48 +0100)
committerJán Tomko <jtomko@redhat.com>
Thu, 12 Dec 2019 13:24:34 +0000 (14:24 +0100)
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>
tools/vsh.c

index 6c78a7a373f087eff2e2e64b8833b8015875de12..dd2c039b47b2102527490fa94b20db233cee2178 100644 (file)
@@ -64,17 +64,6 @@ const vshCmdGrp *cmdGroups;
 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
 vshPrettyCapacity(unsigned long long val, const char **unit)
 {
@@ -361,7 +350,7 @@ vshCmddefCheckInternals(vshControl *ctl,
             }
             if ((p = strchr(name, '=')) &&
                 VIR_STRNDUP(name, name, p - name) < 0)
-                vshErrorOOM();
+                return -1;
             for (j = i + 1; cmd->opts[j].name; j++) {
                 if (STREQ(name, cmd->opts[j].name) &&
                     cmd->opts[j].type != VSH_OT_ALIAS)