Skip to content
Snippets Groups Projects
Verified Commit 45945dff authored by Josef Schlehofer's avatar Josef Schlehofer
Browse files

psmisc: remove it as it isn't in upstream

parent 897ca68e
Branches
Tags
No related merge requests found
#
# Copyright (C) 2006-2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=psmisc
PKG_VERSION:=23.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@SF/psmisc
PKG_MD5SUM:=bbba1f701c02fb50d59540d1ff90d8d1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/psmisc
SECTION:=utils
CATEGORY:=Utilities
DEPENDS:=+libncurses
TITLE:=proc utilities
URL:=http://psmisc.sourceforge.net/
endef
define Package/psmisc/description
psmisc is a set of additional small useful utilities that use
the proc filesystem: fuser, killall, pstree, and prtstat
endef
CONFIGURE_ARGS += \
--disable-harden-flags
MAKE_FLAGS += \
CFLAGS="$(TARGET_CFLAGS)" \
CPPFLAGS="$(TARGET_CPPFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)"
define Package/psmisc/preinst
#!/bin/sh
if [ -e $${IPKG_INSTROOT}/usr/bin/killall ]; then
rm $${IPKG_INSTROOT}/usr/bin/killall;
fi
endef
define Package/psmisc/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) \
$(PKG_INSTALL_DIR)/usr/bin/{fuser,killall,prtstat,pstree} \
$(1)/usr/bin/
endef
define Package/psmisc/postrm
#!/bin/sh
ln -sf ../../bin/busybox $${IPKG_INSTROOT}/usr/bin/killall
$${IPKG_INSTROOT}/usr/bin/killall 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/usr/bin/killall
exit 0
endef
$(eval $(call BuildPackage,psmisc))
From 5dc872bb2fba6421cb8e1ee578f7bd4aaed55f61 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 24 Mar 2016 15:46:14 +0000
Subject: [PATCH] Use UINTPTR_MAX instead of __WORDSIZE
Do not include sys/user.h since it conflicts with
pt_regs struct from kernel APIs in asm/ptrace.h
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Upstream-Status: Pending
src/peekfd.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/peekfd.c b/src/peekfd.c
index cba2130..0d39878 100644
--- a/src/peekfd.c
+++ b/src/peekfd.c
@@ -30,8 +30,11 @@
#include <asm/ptrace.h>
#include <byteswap.h>
#include <endian.h>
+#ifdef __GLIBC__
#include <sys/user.h>
+#endif
#include <stdlib.h>
+#include <stdint.h>
#include <getopt.h>
#include <ctype.h>
@@ -228,11 +231,11 @@ int main(int argc, char **argv)
if (WIFSTOPPED(status)) {
#ifdef PPC
struct pt_regs regs;
- regs.gpr[0] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R0, 0);
- regs.gpr[3] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R3, 0);
- regs.gpr[4] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R4, 0);
- regs.gpr[5] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R5, 0);
- regs.orig_gpr3 = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_ORIG_R3, 0);
+ regs.gpr[0] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R0, 0);
+ regs.gpr[3] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R3, 0);
+ regs.gpr[4] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R4, 0);
+ regs.gpr[5] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R5, 0);
+ regs.orig_gpr3 = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_ORIG_R3, 0);
#elif defined(ARM)
struct pt_regs regs;
ptrace(PTRACE_GETREGS, pid, 0, &regs);
--
1.9.1
diff --git a/src/peekfd.c b/src/peekfd.c
index 32723b5..46f52a2 100644
--- a/src/peekfd.c
+++ b/src/peekfd.c
@@ -50,6 +50,10 @@
#define REG_PARAM2 rsi
#define REG_PARAM3 rdx
#elif PPC
+ #if !defined(__WORDSIZE)
+ #include <bits/reg.h>
+ #endif
+
#define REG_ORIG_ACCUM gpr[0]
#define REG_ACCUM gpr[3]
#define REG_PARAM1 orig_gpr3
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment