VirtualBox

Ignore:
Timestamp:
Oct 19, 2010 11:20:51 AM (14 years ago)
Author:
vboxsync
Message:

Storage/vbox-img: return 1 as exit code if anything went wrong

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/testcase/vbox-img.cpp

    r33224 r33227  
    760760        rc = VDCopy(pSrcDisk, VD_LAST_IMAGE, pDstDisk, pszDstFormat,
    761761                    pszDstFilename, false, 0, uImageFlags, NULL,
    762                     VD_OPEN_FLAGS_NORMAL, NULL, pIfsImageOutput, NULL);
     762                    VD_OPEN_FLAGS_NORMAL | VD_OPEN_FLAGS_SEQUENTIAL, NULL,
     763                    pIfsImageOutput, NULL);
    763764        if (RT_FAILURE(rc))
    764765        {
     
    899900    RTR3Init();
    900901    int rc;
     902    int exitcode = 0;
    901903
    902904    g_pszProgName = RTPathFilename(argv[0]);
     
    963965    rc = VDInit();
    964966    if (RT_FAILURE(rc))
    965         return errorSyntax("Initalizing backends failed! rc=%Rrc\n");
     967    {
     968        errorSyntax("Initalizing backends failed! rc=%Rrc\n", rc);
     969        return 1;
     970    }
    966971
    967972    /*
     
    990995            handlerArg.argv = &argv[iCmdArg];
    991996
    992             rc = s_commandHandlers[commandIndex].handler(&handlerArg);
     997            exitcode = s_commandHandlers[commandIndex].handler(&handlerArg);
    993998            break;
    994999        }
    9951000    }
    9961001    if (!s_commandHandlers[commandIndex].command)
    997         return errorSyntax("Invalid command '%s'", argv[iCmd]);
     1002    {
     1003        errorSyntax("Invalid command '%s'", argv[iCmd]);
     1004        return 1;
     1005    }
    9981006
    9991007    rc = VDShutdown();
    10001008    if (RT_FAILURE(rc))
    1001         return errorSyntax("Unloading backends failed! rc=%Rrc\n", rc);
    1002 
    1003     return rc;
     1009    {
     1010        errorSyntax("Unloading backends failed! rc=%Rrc\n", rc);
     1011        return 1;
     1012    }
     1013
     1014    return exitcode;
    10041015}
    10051016
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette