Drop all lsof related code.
ok jasper@
This commit is contained in:
parent
17e7afcf7f
commit
3eabe57877
@ -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
|
||||
|
||||
|
@ -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 <ajacoutot@gnome.org>
|
||||
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 <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)
|
@ -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 <ajacoutot@gnome.org>
|
||||
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
|
40
devel/libgtop2/patches/patch-sysdeps_openbsd_procwd_c
Normal file
40
devel/libgtop2/patches/patch-sysdeps_openbsd_procwd_c
Normal file
@ -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 <ajacoutot@gnome.org>
|
||||
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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user