From fcb0f32632f74950c361a0a23128ebca05efdca0 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Thu, 16 Aug 2007 22:29:18 -0400 Subject: move all proc stuff into ck-sysdeps --- tools/Makefile.am | 6 +++--- tools/ck-collect-session-info.c | 36 ++++++++++++++++++------------------ tools/ck-get-x11-display-device.c | 18 +++++++++--------- 3 files changed, 30 insertions(+), 30 deletions(-) (limited to 'tools') diff --git a/tools/Makefile.am b/tools/Makefile.am index 98783eb..5283e18 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -56,7 +56,7 @@ ck_collect_session_info_SOURCES = \ ck_collect_session_info_LDADD = \ $(TOOLS_LIBS) \ - $(top_builddir)/src/libckproc.la\ + $(top_builddir)/src/libck.la \ $(NULL) ck_get_x11_server_pid_SOURCES = \ @@ -65,7 +65,7 @@ ck_get_x11_server_pid_SOURCES = \ ck_get_x11_server_pid_LDADD = \ $(TOOLS_LIBS) \ - $(top_builddir)/src/libckproc.la\ + $(top_builddir)/src/libck.la \ $(NULL) ck_get_x11_display_device_SOURCES = \ @@ -74,7 +74,7 @@ ck_get_x11_display_device_SOURCES = \ ck_get_x11_display_device_LDADD = \ $(TOOLS_LIBS) \ - $(top_builddir)/src/libckproc.la\ + $(top_builddir)/src/libck.la \ $(NULL) diff --git a/tools/ck-collect-session-info.c b/tools/ck-collect-session-info.c index 5e8e07d..45abb07 100644 --- a/tools/ck-collect-session-info.c +++ b/tools/ck-collect-session-info.c @@ -32,7 +32,7 @@ #include -#include "proc.h" +#include "ck-sysdeps.h" typedef struct { uid_t uid; @@ -108,7 +108,7 @@ get_filtered_environment (pid_t pid) g_ptr_array_add (env, g_strdup ("PATH=/bin:/usr/bin")); - hash = proc_pid_get_env_hash (pid); + hash = ck_unix_pid_get_env_hash (pid); for (i = 0; i < G_N_ELEMENTS (allowed_env_vars); i++) { const char *var; @@ -221,14 +221,14 @@ get_x11_server_pid (SessionInfo *si, static void fill_x11_info (SessionInfo *si) { - guint xorg_pid; - gboolean can_connect; - gboolean res; - proc_stat_t *xorg_stat; - GError *error; + guint xorg_pid; + gboolean can_connect; + gboolean res; + CkProcessStat *xorg_stat; + GError *error; /* assume this is true then check it */ - si->x11_display = proc_pid_get_env (si->pid, "DISPLAY"); + si->x11_display = ck_unix_pid_get_env (si->pid, "DISPLAY"); if (si->x11_display == NULL) { /* no point continuing */ @@ -261,7 +261,7 @@ fill_x11_info (SessionInfo *si) } error = NULL; - res = proc_stat_new_for_pid (xorg_pid, &xorg_stat, &error); + res = ck_process_stat_new_for_unix_pid (xorg_pid, &xorg_stat, &error); if (! res) { if (error != NULL) { g_warning ("stat on pid %d failed: %s", xorg_pid, error->message); @@ -271,8 +271,8 @@ fill_x11_info (SessionInfo *si) return; } - si->x11_display_device = proc_stat_get_tty (xorg_stat); - proc_stat_free (xorg_stat); + si->x11_display_device = ck_process_stat_get_tty (xorg_stat); + ck_process_stat_free (xorg_stat); si->is_local = TRUE; si->is_local_is_set = TRUE; @@ -284,12 +284,12 @@ fill_x11_info (SessionInfo *si) static gboolean fill_session_info (SessionInfo *si) { - proc_stat_t *stat; - GError *error; - gboolean res; + CkProcessStat *stat; + GError *error; + gboolean res; error = NULL; - res = proc_stat_new_for_pid (si->pid, &stat, &error); + res = ck_process_stat_new_for_unix_pid (si->pid, &stat, &error); if (! res) { if (error != NULL) { g_warning ("stat on pid %d failed: %s", si->pid, error->message); @@ -299,9 +299,9 @@ fill_session_info (SessionInfo *si) return FALSE; } - si->display_device = proc_stat_get_tty (stat); - si->session_type = proc_stat_get_cmd (stat); - proc_stat_free (stat); + si->display_device = ck_process_stat_get_tty (stat); + si->session_type = ck_process_stat_get_cmd (stat); + ck_process_stat_free (stat); fill_x11_info (si); diff --git a/tools/ck-get-x11-display-device.c b/tools/ck-get-x11-display-device.c index 2d414c6..92a7936 100644 --- a/tools/ck-get-x11-display-device.c +++ b/tools/ck-get-x11-display-device.c @@ -32,18 +32,18 @@ #include #include -#include "proc.h" +#include "ck-sysdeps.h" static char * get_tty_for_pid (int pid) { - GError *error; - char *device; - gboolean res; - proc_stat_t *xorg_stat; + GError *error; + char *device; + gboolean res; + CkProcessStat *xorg_stat; error = NULL; - res = proc_stat_new_for_pid (pid, &xorg_stat, &error); + res = ck_process_stat_new_for_unix_pid (pid, &xorg_stat, &error); if (! res) { if (error != NULL) { g_warning ("stat on pid %d failed: %s", pid, error->message); @@ -53,8 +53,8 @@ get_tty_for_pid (int pid) return NULL; } - device = proc_stat_get_tty (xorg_stat); - proc_stat_free (xorg_stat); + device = ck_process_stat_get_tty (xorg_stat); + ck_process_stat_free (xorg_stat); return device; } @@ -84,7 +84,7 @@ get_peer_pid (int fd) } static Display * -display_init (char *display_name) +display_init (const char *display_name) { Display *xdisplay; -- cgit