pkgsrc/sysutils/skill/patches/patch-ab
obache 13c3b8596d Update skill to 4.1.4.
Based on patch provided by Yakovetsky Vladimir in PR 36788.
Add target for FreeBSD and Linux (and IRIX/OSF/AIX/HUPX, not tested).
XXX: Should use distribution's Config script instead?

4.1.2: Minor feature enhancements
This release features support for Cygwin. It validates on Solaris 5.9-10, HP-UX
11.23, and FreeBSD 5.3. There is an HP-UX 64-bit fix. The FreeBSD 5.x special
proc handling was improved, and there were some minor cleanups.

4.1.3: Minor feature enhancements
This release adds support for AIX v5. It has a work-around for a Solaris issue
where the process open() call would hang.

4.1.4: Minor bugfixes
skill and snice now act on each process only once (for systems like BSD that
return the same Process ID multiple times, once for each instantiated thread).
Support has also been added for FreeBSD 6.2 and HP-UX 11.31.
2007-10-27 02:52:22 +00:00

41 lines
1 KiB
Text

$NetBSD: patch-ab,v 1.13 2007/10/27 02:52:23 obache Exp $
--- main.c.orig 2007-05-04 20:56:20.000000000 +0000
+++ main.c
@@ -44,8 +44,18 @@ const char *CopyrightVersion = "%s %s\n\
#include "conf.h"
#include <stdio.h>
+#ifdef __STDC__
+#include <stdlib.h>
+#endif
#include <errno.h>
#include <pwd.h>
+#ifdef __NetBSD__
+#include <sys/sysctl.h>
+#endif
+
+#ifndef KI_MAXCOMLEN /* Pre NetBSD/1.5. Missing on !NetBSD */
+#define KI_MAXCOMLEN 24
+#endif
/*
* Processes which could not be checked -- usually due to permission
@@ -137,7 +147,7 @@ main(argc, argv)
for (i = 0; i < CmdIndx; i++) {
cmdp = (CmdList + i);
if ((cmdp->flags & CMD_FLAG_EXACT) != 0 &&
- STREQU(CMD, cmdp->cmd.cmdstr))
+ STRNEQU(CMD, cmdp->cmd.cmdstr, KI_MAXCOMLEN-8))
break;
else if ((cmdp->flags & CMD_FLAG_REGEX) != 0 &&
RegexMatch(CMD, cmdp) != 0)
@@ -384,8 +394,6 @@ Usage(error)
char *
SysErr()
{
- extern int errno;
-
#if defined(HAS_STRERROR) || defined(_LP64)
char *se = strerror(errno);
return((se==NULL)? "unknown error": se);