[PATCH 1/1] Fix warnings
Joe Marcus Clarke
marcus at FreeBSD.org
Mon Aug 27 17:13:04 PDT 2007
Clean up the code to quiet some warnings. Note: the Solaris backend
might want to consider renaming proc_pid_get_uid() to
ck_unix_pid_get_uid().
---
src/ck-sysdeps-freebsd.c | 42 ++++--------------------------------------
1 files changed, 4 insertions(+), 38 deletions(-)
diff --git a/src/ck-sysdeps-freebsd.c b/src/ck-sysdeps-freebsd.c
index 99a1791..7c43931 100644
--- a/src/ck-sysdeps-freebsd.c
+++ b/src/ck-sysdeps-freebsd.c
@@ -108,16 +108,9 @@ ck_process_stat_get_cmd (CkProcessStat *stat)
return g_strdup (stat->cmd);
}
-/* adapted from procps */
char *
ck_process_stat_get_tty (CkProcessStat *stat)
{
- guint dev;
- char *tty;
- guint dev_maj;
- guint dev_min;
- pid_t pid;
-
g_return_val_if_fail (stat != NULL, NULL);
return g_strdup (stat->tty_text);
@@ -173,7 +166,7 @@ stat2proc (pid_t pid,
P->rss = p.ki_rssize;
P->vsize = p.ki_size;
P->start_time = p.ki_start.tv_sec;
- P->wchan = p.ki_wchan;
+ P->wchan = (unsigned long) p.ki_wchan;
P->state = p.ki_stat;
P->nice = p.ki_nice;
P->flags = p.ki_sflag;
@@ -208,11 +201,8 @@ ck_process_stat_new_for_unix_pid (pid_t pid,
CkProcessStat **stat,
GError **error)
{
- char *path;
- char *contents;
- gsize length;
- gboolean res;
- GError *local_error;
+ gboolean res;
+ GError *local_error = NULL;
CkProcessStat *proc;
g_return_val_if_fail (pid > 1, FALSE);
@@ -305,7 +295,7 @@ ck_unix_pid_get_env (pid_t pid,
}
uid_t
-proc_pid_get_uid (pid_t pid)
+ck_unix_pid_get_uid (pid_t pid)
{
uid_t uid;
gboolean res;
@@ -324,30 +314,6 @@ proc_pid_get_uid (pid_t pid)
return uid;
}
-pid_t
-proc_pid_get_ppid (pid_t pid)
-{
- int ppid;
- gboolean res;
- CkProcessStat *stat;
-
- g_return_val_if_fail (pid > 1, 0);
-
- ppid = -1;
-
- res = ck_process_stat_new_for_unix_pid (pid, &stat, NULL);
- if (! res) {
- goto out;
- }
-
- ppid = ck_process_stat_get_ppid (stat);
-
- ck_process_stat_free (stat);
-
- out:
- return ppid;
-}
-
gboolean
ck_get_max_num_consoles (guint *num)
{
--
1.5.2.1
More information about the hal
mailing list