[Fix] Cleanup per github comments.
authorLevi Bard <levi@unity3d.com>
Mon, 22 Nov 2010 13:16:34 +0000 (14:16 +0100)
committerLevi Bard <levi@unity3d.com>
Mon, 31 Jan 2011 13:06:05 +0000 (14:06 +0100)
 * io-layer/processes.c:
 * io-layer/process-private.h:
  Cleanup per github comments.

License: MIT/X11

mono/io-layer/process-private.h
mono/io-layer/processes.c

index fc955fbb56ee548e140619f499fec1a6ce36b390..bb1c69ae31db664bf10e1694b36d596221ce79e0 100644 (file)
@@ -17,6 +17,7 @@
 #define _WAPI_PROCESS_CURRENT (gpointer)0xFFFFFFFF
 
 /* This marks a system process that we don't have a handle on */
+/* FIXME: Cope with PIDs > sizeof guint */
 #define _WAPI_PROCESS_UNHANDLED (1 << (8*sizeof(pid_t)-1))
 #define _WAPI_PROCESS_UNHANDLED_PID_MASK (-1 & ~_WAPI_PROCESS_UNHANDLED)
 
index f1d8eb0e4c772f7bcc5d46cc20a435600c5c5ad6..d0501a7dbe0f9638683bdc972f12147a0acaa75f 100644 (file)
@@ -1590,7 +1590,7 @@ gboolean EnumProcesses (guint32 *pids, guint32 len, guint32 *needed)
        count = proclength / sizeof(struct kinfo_proc);
 #endif
        fit = len / sizeof(guint32);
-       for (i = 0, j = 0; j < fit && i < count; i++) {
+       for (i = 0, j = 0; j< fit && i < count; i++) {
 #if defined(__OpenBSD__)
                pids [j++] = result [i].p_pid;
 #else
@@ -2322,8 +2322,8 @@ static gchar *get_process_name_from_proc (pid_t pid)
 #else
        FILE *fp;
        gchar *filename = NULL;
-       gchar buf[256];
 #endif
+       gchar buf[256];
        gchar *ret = NULL;
 
 #if defined(PLATFORM_SOLARIS)
@@ -2341,8 +2341,8 @@ static gchar *get_process_name_from_proc (pid_t pid)
        }
        g_free (filename);
 #elif defined(PLATFORM_MACOSX)
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5) && !defined(__arm__)
-       /* No proc name on OSX < 10.5 nor iOS */
+#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5) && !defined (__mono_ppc__) && !defined(__arm__)
+       /* No proc name on OSX < 10.5 nor ppc nor iOS */
        memset (buf, '\0', sizeof(buf));
        proc_name (pid, buf, sizeof(buf));
        if (strlen (buf) > 0)