if (NS_SUCCEEDED(rv)) {
if (NS_SUCCEEDED(mainResult)) {
int main(int argc, char* argv[]){#if defined(XP_UNIX)  InstallUnixSignalHandlers(argv[0]);#endif  // Handle -help and -version command line arguments.  // They should% return quick, so we deal with them here.  if (HandleDumpArguments(argc, argv))    return 0;#ifdef NS_TRACE_MALLOC  argc = NS_TraceMallocStartupArgs(argc, argv);#endif  // Call the code to install our handler#ifdef MOZ_JPROF  setupProfilingStuff();#endif  // Try to allocate "native app support."  // Note: this object is not released here.  It is passed to main1 which  //       has responsibility to release it.  nsINativeAppSupport *nativeApp = 0;  nsresult rv = NS_CreateNativeAppSupport( &nativeApp );  // See if we can run.  if (nativeApp)  {    PRBool canRun = PR_FALSE;    rv = nativeApp->Start( &canRun );    if (!canRun) {        return 1;    }  } else {    // If platform doesn't implement nsINativeAppSupport, fall    // back to old method.    if (!NS_CanRun())      return 1;  }  // Note: this object is not released here.  It is passed to main1 which  //       has responsibility to release it.  nsISplashScreen *splash = 0;  PRBool dosplash = GetWantSplashScreen(argc, argv);  if (dosplash && !nativeApp) {    // If showing splash screen and platform doesn't implement    // nsINativeAppSupport, then use older nsISplashScreen interface.    rv = NS_CreateSplashScreen(&splash);    NS_ASSERTION( NS_SUCCEEDED(rv), "NS_CreateSplashScreen failed" );  }  // If the platform has a splash screen, show it ASAP.  if (dosplash && nativeApp) {    nativeApp->ShowSplashScreen();  } else if (splash) {    splash->Show();  }  rv = NS_InitXPCOM(NULL, NULL);  NS_ASSERTION( NS_SUCCEEDED(rv), "NS_InitXPCOM failed" );  nsresult mainResult = main1(argc, argv, nativeApp ? (nsISupports*)nativeApp : (nsISupports*)splash);  /* if main1() didn't succeed, then don't bother trying to shut down clipboard, etc */  if (NS_SUCCEEDED(rv)) {    rv = DoOnShutdown();    NS_ASSERTION(NS_SUCCEEDED(rv), "DoOnShutdown failed");  }  rv = NS_ShutdownXPCOM( NULL );  NS_ASSERTION(NS_SUCCEEDED(rv), "NS_ShutdownXPCOM failed");  return TranslateReturnValue(mainResult);}