harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r794510 - in /harmony/enhanced/classlib/trunk/modules: auth/src/main/native/auth/unix/ luni/src/main/native/luni/unix/ portlib/src/main/native/port/unix/
Date Thu, 16 Jul 2009 03:39:53 GMT
Author: ndbeyer
Date: Thu Jul 16 03:39:53 2009
New Revision: 794510

URL: http://svn.apache.org/viewvc?rev=794510&view=rev
Log:
Apply patch for HARMONY-6266 - Building in release mode fails with gcc version 4.3.3

Modified:
    harmony/enhanced/classlib/trunk/modules/auth/src/main/native/auth/unix/authnix.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/procimpl.c
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyfiletext.c
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyosdump.c
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysl.c

Modified: harmony/enhanced/classlib/trunk/modules/auth/src/main/native/auth/unix/authnix.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/auth/src/main/native/auth/unix/authnix.c?rev=794510&r1=794509&r2=794510&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/auth/src/main/native/auth/unix/authnix.c (original)
+++ harmony/enhanced/classlib/trunk/modules/auth/src/main/native/auth/unix/authnix.c Thu Jul
16 03:39:53 2009
@@ -131,6 +131,7 @@
     (*jenv)->SetObjectField (jenv, thiz, jf_groupname, (*jenv)->NewStringUTF (jenv,
pg->gr_name));
 
     gcount = getgroups(0, NULL);
+    
     if( 0 != gcount ) {
 
         gid_t * gids;
@@ -138,10 +139,13 @@
         jlong * jgs_raw;
         jobjectArray jgsnames;
         int i;
+        int gcount_temp;
 
         gids = (gid_t*)hymem_allocate_memory(gcount*sizeof(gid_t));
 
-        getgroups(gcount, gids);
+        /* capture return code to fix compiler warning */
+        gcount_temp = getgroups(gcount, gids);
+        
         jgs = (*jenv)->NewLongArray (jenv, gcount);
         jgs_raw = (*jenv)->GetLongArrayElements (jenv, jgs, NULL);
         jgsnames = (*jenv)->NewObjectArray (jenv, gcount, jclassString, NULL);

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/procimpl.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/procimpl.c?rev=794510&r1=794509&r2=794510&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/procimpl.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/procimpl.c Thu
Jul 16 03:39:53 2009
@@ -129,6 +129,7 @@
   int execvFailure[2] = {0,0};
   int forkedChildIsRunning[2] = {0,0};
   int error = 0;
+  int writeRC = 0;
 
   /* Build the new io pipes (in/out/err) */
   if (pipe(newFD[0]) == -1) goto error;
@@ -173,11 +174,14 @@
     dup2(newFD[2][1], 2);
 
     /* tells the parent that that very process is running */
-    write(forkedChildIsRunning[1], &dummy, 1);
+    if (-1 == write(forkedChildIsRunning[1], &dummy, 1)) {
+      goto error;
+    }
 
     if (dir) {
       if (chdir(dir) == -1) {
-        write(execvFailure[1], &errno, sizeof(errno));
+        /* capture return code to fix compiler warning */
+        writeRC = write(execvFailure[1], &errno, sizeof(errno));
         exit(-1);
       }
     }
@@ -192,7 +196,8 @@
     /* ===================================================== */
 
     /* if we get here ==> tell the parent that the execv failed ! */
-    write(execvFailure[1], &errno, sizeof(errno));
+    /* capture return code to fix compiler warning */
+    writeRC = write(execvFailure[1], &errno, sizeof(errno));
     /* If the exec failed, we must exit or there will be two VM processes running. */
     exit(rc);
   } else {
@@ -212,7 +217,9 @@
     *(procHandle) = (IDATA) grdpid;
 
     /* let the forked child start. */
-    read(forkedChildIsRunning[0], &dummy, 1);
+    if (-1 == read(forkedChildIsRunning[0], &dummy, 1)) {
+    	goto error;
+    }
     close(forkedChildIsRunning[0]);
     close(forkedChildIsRunning[1]);
 

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyfiletext.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyfiletext.c?rev=794510&r1=794509&r2=794510&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyfiletext.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyfiletext.c
Thu Jul 16 03:39:53 2009
@@ -230,14 +230,14 @@
   const U_8 *cursor = buf;
   IDATA newLength = 0;
   int hasHighChars = 0;
+  int wcresult;
   /* reset the shift state */
-  wctomb (NULL, 0);
+  wcresult = wctomb (NULL, 0);
   while (cursor < end)
     {
       if ((*cursor & 0x80) == 0x80)
         {
           char temp[MB_CUR_MAX];
-          int wcresult;
           U_16 unicode;
           U_32 numberU8Consumed =
             decodeUTF8CharN (cursor, &unicode, end - cursor);

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyosdump.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyosdump.c?rev=794510&r1=794509&r2=794510&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyosdump.c (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyosdump.c Thu
Jul 16 03:39:53 2009
@@ -83,7 +83,10 @@
       if (lastSep != NULL)
         {
           lastSep[1] = '\0';
-          chdir (filename);
+          if (0 != chdir (filename))
+            {
+              return -1;
+            }
         }
 
       /* Ensure we get default action (core) - reset primary&app handlers */

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysl.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysl.c?rev=794510&r1=794509&r2=794510&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysl.c (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysl.c Thu Jul
16 03:39:53 2009
@@ -303,7 +303,7 @@
   end = &errBuf[bufLen - 1];
   walk = error;
   /* reset the shift state */
-  mbtowc (NULL, NULL, 0);
+  ret = mbtowc (NULL, NULL, 0);
   while (*walk)
     {
       ret = mbtowc (&ch, walk, MB_CUR_MAX);



Mime
View raw message