From 3eabe57877dbfa332a5c44f986804d6f4aaf2613 Mon Sep 17 00:00:00 2001 From: ajacoutot Date: Thu, 23 Jan 2014 14:06:34 +0000 Subject: [PATCH] Drop all lsof related code. ok jasper@ --- devel/libgtop2/Makefile | 4 +- .../patch-sysdeps_openbsd_glibtop_private_c | 42 +++++++++++++++++++ .../patch-sysdeps_openbsd_glibtop_private_h | 17 ++++++++ .../patches/patch-sysdeps_openbsd_procwd_c | 40 ++++++++++++++++++ 4 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 devel/libgtop2/patches/patch-sysdeps_openbsd_glibtop_private_c create mode 100644 devel/libgtop2/patches/patch-sysdeps_openbsd_glibtop_private_h create mode 100644 devel/libgtop2/patches/patch-sysdeps_openbsd_procwd_c diff --git a/devel/libgtop2/Makefile b/devel/libgtop2/Makefile index 325c8cceb36..4c784b3334a 100644 --- a/devel/libgtop2/Makefile +++ b/devel/libgtop2/Makefile @@ -1,11 +1,11 @@ -# $OpenBSD: Makefile,v 1.110 2013/12/09 16:55:26 ajacoutot Exp $ +# $OpenBSD: Makefile,v 1.111 2014/01/23 14:06:34 ajacoutot Exp $ COMMENT= portable library for obtaining system information GNOME_VERSION= 2.28.5 GNOME_PROJECT= libgtop PKGNAME= libgtop2-${VERSION} -REVISION= 6 +REVISION= 7 SHARED_LIBS= gtop-2.0 9.0 # .9.0 diff --git a/devel/libgtop2/patches/patch-sysdeps_openbsd_glibtop_private_c b/devel/libgtop2/patches/patch-sysdeps_openbsd_glibtop_private_c new file mode 100644 index 00000000000..f91c097d6a8 --- /dev/null +++ b/devel/libgtop2/patches/patch-sysdeps_openbsd_glibtop_private_c @@ -0,0 +1,42 @@ +$OpenBSD: patch-sysdeps_openbsd_glibtop_private_c,v 1.1 2014/01/23 14:06:34 ajacoutot Exp $ + +From ecbfade5287c1a0a8973d5f18acb4b08f203f4fb Mon Sep 17 00:00:00 2001 +From: Antoine Jacoutot +Date: Thu, 23 Jan 2014 14:03:36 +0000 +Subject: openbsd: really drop all lsof related code + +--- sysdeps/openbsd/glibtop_private.c.orig Thu Jan 23 14:12:40 2014 ++++ sysdeps/openbsd/glibtop_private.c Thu Jan 23 14:12:51 2014 +@@ -12,32 +12,6 @@ + #include + #include + +-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/devel/libgtop2/patches/patch-sysdeps_openbsd_glibtop_private_h b/devel/libgtop2/patches/patch-sysdeps_openbsd_glibtop_private_h new file mode 100644 index 00000000000..a5cc1087175 --- /dev/null +++ b/devel/libgtop2/patches/patch-sysdeps_openbsd_glibtop_private_h @@ -0,0 +1,17 @@ +$OpenBSD: patch-sysdeps_openbsd_glibtop_private_h,v 1.1 2014/01/23 14:06:34 ajacoutot Exp $ + +From ecbfade5287c1a0a8973d5f18acb4b08f203f4fb Mon Sep 17 00:00:00 2001 +From: Antoine Jacoutot +Date: Thu, 23 Jan 2014 14:03:36 +0000 +Subject: openbsd: really drop all lsof related code + +--- sysdeps/openbsd/glibtop_private.h.orig Thu Jan 23 14:13:45 2014 ++++ sysdeps/openbsd/glibtop_private.h Thu Jan 23 14:13:51 2014 +@@ -34,7 +34,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/devel/libgtop2/patches/patch-sysdeps_openbsd_procwd_c b/devel/libgtop2/patches/patch-sysdeps_openbsd_procwd_c new file mode 100644 index 00000000000..109dfdb09d2 --- /dev/null +++ b/devel/libgtop2/patches/patch-sysdeps_openbsd_procwd_c @@ -0,0 +1,40 @@ +$OpenBSD: patch-sysdeps_openbsd_procwd_c,v 1.1 2014/01/23 14:06:34 ajacoutot Exp $ + +From ecbfade5287c1a0a8973d5f18acb4b08f203f4fb Mon Sep 17 00:00:00 2001 +From: Antoine Jacoutot +Date: Thu, 23 Jan 2014 14:03:36 +0000 +Subject: openbsd: really drop all lsof related code + +--- sysdeps/openbsd/procwd.c.orig Thu Jan 23 14:11:05 2014 ++++ sysdeps/openbsd/procwd.c Thu Jan 23 14:11:24 2014 +@@ -96,29 +96,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; + }