/*
 * Copyright (c) 2011 The Native Client Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * be found in the LICENSE file.
 */

#include <stdlib.h>
#include <stdio.h>

#include "native_client/src/include/portability.h"
#include "native_client/src/shared/platform/nacl_exit.h"
#include "native_client/src/trusted/service_runtime/nacl_signal.h"


void NaClAbort(void) {
  NaClExit(-SIGABRT);
}

void NaClExit(int err_code) {
#ifdef COVERAGE
  /* Give coverage runs a chance to flush coverage data */
  exit(err_code);
#else
  /* If the process is scheduled for termination, wait for it.*/
  if (TerminateProcess(GetCurrentProcess(), err_code)) {
    while(1);
  }

  /* Otherwise use the standard C process exit to bybass destructors. */
  ExitProcess(err_code);
#endif
}


/*
 * Copyright 2011 The Native Client Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can
 * be found in the LICENSE file.
 */

#include <stdlib.h>
#include <stdio.h>

#include "native_client/src/include/portability.h"
#include "native_client/src/shared/platform/nacl_exit.h"
#include "native_client/src/trusted/service_runtime/nacl_signal.h"


void NaClAbort(void) {
  NaClExit(-SIGABRT);
}

void NaClExit(int err_code) {
#ifdef COVERAGE
  /* Give coverage runs a chance to flush coverage data */
  exit(err_code);
#else
  /* If the process is scheduled for termination, wait for it.*/
  if (TerminateProcess(GetCurrentProcess(), err_code)) {
    printf("Terminate passed, but returned.\n");
    while(1);
  }
  printf("Terminate failed with %d.\n", GetLastError());

  /* Otherwise use the standard C process exit to bybass destructors. */
  ExitProcess(err_code);
#endif
}


--- 
+++ 
@@ -1,6 +1,6 @@
 /*
- * Copyright 2011 The Native Client Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can
+ * Copyright (c) 2011 The Native Client Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
  * be found in the LICENSE file.
  */
 
@@ -23,10 +23,8 @@
 #else
   /* If the process is scheduled for termination, wait for it.*/
   if (TerminateProcess(GetCurrentProcess(), err_code)) {
-    printf("Terminate passed, but returned.\n");
     while(1);
   }
-  printf("Terminate failed with %d.\n", GetLastError());
 
   /* Otherwise use the standard C process exit to bybass destructors. */
   ExitProcess(err_code);
Remove printfs in exit path

Due to failures in Win7Atom I added printfs for debugging.  This CL removes the printfs which should
not be in the shipping code.

TEST= all
BUG= nacl1561
Review URL: http://codereview.chromium.org/6825057

git-svn-id: 721b910a23eff8a86f00c8fd261a7587cddf18f8@4846 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
