[libgtop] openbsd: really drop all lsof related code
- From: Antoine Jacoutot <ajacoutot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgtop] openbsd: really drop all lsof related code
- Date: Thu, 23 Jan 2014 14:04:04 +0000 (UTC)
commit ecbfade5287c1a0a8973d5f18acb4b08f203f4fb
Author: Antoine Jacoutot <ajacoutot gnome org>
Date: Thu Jan 23 15:03:36 2014 +0100
openbsd: really drop all lsof related code
sysdeps/openbsd/glibtop_private.c | 26 --------------------------
sysdeps/openbsd/glibtop_private.h | 1 -
sysdeps/openbsd/procwd.c | 25 +------------------------
3 files changed, 1 insertions(+), 51 deletions(-)
---
diff --git a/sysdeps/openbsd/glibtop_private.c b/sysdeps/openbsd/glibtop_private.c
index 96c9e06..87bec62 100644
--- a/sysdeps/openbsd/glibtop_private.c
+++ b/sysdeps/openbsd/glibtop_private.c
@@ -10,32 +10,6 @@
#include <glib.h>
#include <errno.h>
-char *
-execute_lsof(pid_t pid) {
- char *output = NULL;
- char *lsof;
- char *command;
- int exit_status;
-
- lsof = g_find_program_in_path("lsof");
- if (lsof == NULL)
- return NULL;
-
- command = g_strdup_printf("%s -n -P -Fftn -p %d", lsof, pid);
- g_free(lsof);
-
- if (g_spawn_command_line_sync (command, &output, NULL, &exit_status, NULL)) {
- if (exit_status != 0) {
- g_warning("Could not execute \"%s\" (%i)\nMake sure lsof(8) is installed sgid kmem.",
- command, exit_status);
- output = NULL;
- }
- }
-
- g_free(command);
- return output;
-}
-
/* Ported from linux/glibtop_private.c */
gboolean
safe_readlink(const char *path, char *buf, int bufsiz)
diff --git a/sysdeps/openbsd/glibtop_private.h b/sysdeps/openbsd/glibtop_private.h
index 855afa1..ba5738b 100644
--- a/sysdeps/openbsd/glibtop_private.h
+++ b/sysdeps/openbsd/glibtop_private.h
@@ -32,7 +32,6 @@
G_BEGIN_DECLS
-char *execute_lsof(pid_t pid);
gboolean safe_readlink(const char *path, char *buf, int bufsiz);
G_END_DECLS
diff --git a/sysdeps/openbsd/procwd.c b/sysdeps/openbsd/procwd.c
index 56f9237..fcf386e 100644
--- a/sysdeps/openbsd/procwd.c
+++ b/sysdeps/openbsd/procwd.c
@@ -94,29 +94,6 @@ parse_output(const char *output, glibtop_proc_wd *buf)
char**
glibtop_get_proc_wd_s(glibtop *server, glibtop_proc_wd *buf, pid_t pid)
{
- char path[MAXPATHLEN];
- char *output;
-
- memset (buf, 0, sizeof (glibtop_proc_wd));
-
- g_snprintf(path, sizeof(path), "/proc/%u/file", pid);
- if (safe_readlink(path, buf->exe, sizeof(buf->exe)))
- buf->flags |= (1 << GLIBTOP_PROC_WD_EXE);
-
- output = execute_lsof(pid);
- if (output != NULL) {
- GPtrArray *dirs;
-
- dirs = parse_output(output, buf);
- g_free(output);
-
- buf->number = dirs->len;
- buf->flags |= (1 << GLIBTOP_PROC_WD_NUMBER);
-
- g_ptr_array_add(dirs, NULL);
-
- return (char **)g_ptr_array_free(dirs, FALSE);
- }
-
+ /* TODO */
return NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]