mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-10-01 07:56:52 -04:00
42 lines
1.0 KiB
Plaintext
42 lines
1.0 KiB
Plaintext
$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);
|