提交 08f00f0d 编写于 作者: L Levi Bard

[Fix] Cleanup per github comments.

 * io-layer/processes.c:
 * io-layer/process-private.h:
  Cleanup per github comments.

License: MIT/X11
上级 060c61e0
......@@ -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)
......
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册