You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by hi...@apache.org on 2007/05/16 19:48:50 UTC

svn commit: r538667 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/cmain.c

Author: hindessm
Date: Wed May 16 10:48:49 2007
New Revision: 538667

URL: http://svn.apache.org/viewvc?view=rev&rev=538667
Log:
Exiting silently with 0 exit code when hyport_init_library fails is
probably not very helpful.  So now it outputs a message and exits with
a non-zero return code - the return code from hyport_init_library
which usually means the error can be found in
deploy/include/hyporterror.h.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/cmain.c

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/cmain.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/cmain.c?view=diff&rev=538667&r1=538666&r2=538667
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/cmain.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/cmain.c Wed May 16 10:48:49 2007
@@ -21,9 +21,7 @@
 #include "main_hlp.h"
 #endif /* HY_NO_THR */
 #include <stdlib.h>             /* for malloc for atoe and abort */
-#ifdef HY_NO_THR
 #include <stdio.h>
-#endif /* HY_NO_THR */
 
 struct haCmdlineOptions
 {
@@ -128,13 +126,14 @@
    * for on the stack.  This version may be different from the one in the linked DLL.
    */
   HYPORT_SET_VERSION (&portLibraryVersion, HYPORT_CAPABILITY_MASK);
-  if (0 ==
+  rc =
 #ifndef HY_NO_THR
       hyport_init_library (&hyportLibrary, &portLibraryVersion,
 #else /* HY_NO_THR */
 	  port_init_library_func (&hyportLibrary, &portLibraryVersion,
 #endif /* HY_NO_THR */
-                           sizeof (HyPortLibrary)))
+                                  sizeof (HyPortLibrary));
+   if (rc == 0)
     {
       options.argc = argc;
       options.argv = argv;
@@ -159,6 +158,9 @@
       }
 #endif /* HY_NO_SIG */
       hyportLibrary.port_shutdown_library (&hyportLibrary);
+    } else {
+        fprintf( stderr,
+                 "hyport_init_library function failed in hyprt library\n" );
     }
 
   return rc;