View | Details | Raw Unified | Return to bug 146709 | Differences between
and this patch

Collapse All | Expand All

(-)psmisc/Makefile (-3 / +3 lines)
Lines 6-17 Link Here
6
#
6
#
7
7
8
PORTNAME=	psmisc
8
PORTNAME=	psmisc
9
PORTVERSION=	22.9
9
PORTVERSION=	22.11
10
CATEGORIES=	sysutils
10
CATEGORIES=	sysutils
11
MASTER_SITES=	SF
11
MASTER_SITES=	SF
12
MASTER_SITE_SUBDIR=	${PORTNAME}/${PORTNAME}
12
MASTER_SITE_SUBDIR=	${PORTNAME}/${PORTNAME}
13
13
14
MAINTAINER=	ports@FreeBSD.org
14
MAINTAINER=	douglas@douglasthrift.net
15
COMMENT=	A port of the Linux pstree, killall and pidof commands
15
COMMENT=	A port of the Linux pstree, killall and pidof commands
16
16
17
GNU_CONFIGURE=	yes
17
GNU_CONFIGURE=	yes
Lines 19-25 Link Here
19
USE_GMAKE=	yes
19
USE_GMAKE=	yes
20
20
21
CONFLICTS=	pstree-2.* \
21
CONFLICTS=	pstree-2.* \
22
		pidof-*
22
		pidof-[0-9]*
23
23
24
PLIST_FILES=	bin/killall \
24
PLIST_FILES=	bin/killall \
25
		bin/pidof \
25
		bin/pidof \
(-)psmisc/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (psmisc-22.9.tar.gz) = c242530de46b951ab10a2237a6048a9c
1
MD5 (psmisc-22.11.tar.gz) = b5d32aa285b75c59dee96d3ea26a4881
2
SHA256 (psmisc-22.9.tar.gz) = c98aef4bc379790229c54c8e7d97b1d1ab898346bfffcde54fcf585a3e353edd
2
SHA256 (psmisc-22.11.tar.gz) = 8fff37557f5150d89ef9afc03133731da3eaa2bad1a94f64355218a68b884536
3
SIZE (psmisc-22.9.tar.gz) = 316530
3
SIZE (psmisc-22.11.tar.gz) = 375038
(-)psmisc/files/patch-src-pstree.c (-17 / +53 lines)
Lines 1-14 Link Here
1
--- src/pstree.c.orig	2009-12-27 15:46:47.000000000 +0900
1
--- src/pstree.c.orig	2010-04-08 05:20:10.000000000 -0700
2
+++ src/pstree.c	2010-01-03 00:52:21.437862505 +0900
2
+++ src/pstree.c	2010-05-18 07:20:57.583839746 -0700
3
@@ -37,6 +37,7 @@
3
@@ -37,6 +37,10 @@
4
 #include <term.h>
4
 #include <term.h>
5
 #include <termios.h>
5
 #include <termios.h>
6
 #include <langinfo.h>
6
 #include <langinfo.h>
7
+#ifdef __FreeBSD__
8
+#include <locale.h>
7
+#include <limits.h>
9
+#include <limits.h>
10
+#endif
8
 #include <assert.h>
11
 #include <assert.h>
9
 #include <sys/types.h>
12
 #include <sys/types.h>
10
 #include <sys/stat.h>
13
 #include <sys/stat.h>
11
@@ -590,7 +591,11 @@
14
@@ -590,7 +594,11 @@
12
   struct dirent *de;
15
   struct dirent *de;
13
   FILE *file;
16
   FILE *file;
14
   struct stat st;
17
   struct stat st;
Lines 20-50 Link Here
20
   char *buffer;
23
   char *buffer;
21
   size_t buffer_size;
24
   size_t buffer_size;
22
   char readbuf[BUFSIZ + 1];
25
   char readbuf[BUFSIZ + 1];
23
@@ -623,7 +628,7 @@
26
@@ -623,7 +631,11 @@
24
     if ((pid = (pid_t) atoi(de->d_name)) != 0) {
27
     if ((pid = (pid_t) atoi(de->d_name)) != 0) {
25
       if (! (path = malloc(strlen(PROC_BASE) + strlen(de->d_name) + 10)))
28
       if (! (path = malloc(strlen(PROC_BASE) + strlen(de->d_name) + 10)))
26
         exit(2);
29
         exit(2);
27
-      sprintf(path, "%s/%d/stat", PROC_BASE, pid);
30
+#ifdef __FreeBSD__
28
+      sprintf (path, "%s/%d/status", PROC_BASE, pid);
31
+      sprintf(path, "%s/%d/status", PROC_BASE, pid);
32
+#else
33
       sprintf(path, "%s/%d/stat", PROC_BASE, pid);
34
+#endif
29
       if ((file = fopen(path, "r")) != NULL) {
35
       if ((file = fopen(path, "r")) != NULL) {
30
         empty = 0;
36
         empty = 0;
31
         sprintf(path, "%s/%d", PROC_BASE, pid);
37
         sprintf(path, "%s/%d", PROC_BASE, pid);
32
@@ -638,6 +643,10 @@
38
@@ -638,6 +650,29 @@
33
           perror(path);
39
           perror(path);
34
           exit(1);
40
           exit(1);
35
         }
41
         }
36
+#ifdef __FreeBSD__
42
+#ifdef __FreeBSD__
37
+        if (fscanf(file, "%s %*d %d", comm, &ppid) == 2)
43
+        /* Read comm and ppid */
38
+          add_proc(comm, pid, ppid, st.st_uid, NULL, 0, 0);
44
+        if (fscanf(file, "%s %*d %d", readbuf, &ppid) == 2) {
45
+          tmpptr = readbuf;
46
+          size = 0;
47
+          /* Unescape comm */
48
+          do {
49
+            if (*tmpptr == '\\')
50
+            {
51
+              char tmp = tmpptr[4];
52
+              tmpptr[4] = 0;
53
+              comm[size++] = strtol(++tmpptr, NULL, 8);
54
+              tmpptr += 2;
55
+              tmpptr[1] = tmp;
56
+            }
57
+            else
58
+              comm[size++] = *tmpptr;
59
+          } while (*++tmpptr);
60
+          comm[size] = 0;
61
+          /* Balance braces */
62
+          {
63
+            {
39
+#else
64
+#else
40
         size = fread(readbuf, 1, BUFSIZ, file);
65
         size = fread(readbuf, 1, BUFSIZ, file);
41
         if (ferror(file) == 0) {
66
         if (ferror(file) == 0) {
42
           readbuf[size] = 0;
67
           readbuf[size] = 0;
43
@@ -725,6 +734,7 @@
68
@@ -692,6 +727,7 @@
44
             }
69
                   (void) closedir(taskdir);
45
           }
70
                 }
46
         }
71
               free(taskpath);
47
+#endif /*__FreeBSD__*/
72
+#endif /*__FreeBSD__*/
48
         (void) fclose(file);
73
               if (!print_args)
49
       }
74
 #ifdef WITH_SELINUX
50
       free(path);
75
                 add_proc(comm, pid, ppid, st.st_uid, NULL, 0, 0, scontext);
76
@@ -860,6 +896,10 @@
77
      * command-line options, if given.
78
      */
79
 
80
+#ifdef __FreeBSD__
81
+    /* Actually set the locale because nl_langinfo won't do it. */
82
+    setlocale(LC_CTYPE, "");
83
+#endif
84
     if (isatty(1) && !strcmp(nl_langinfo(CODESET), "UTF-8")) {
85
         /* Use UTF-8 symbols if the locale's character set is UTF-8. */
86
         sym = &sym_utf;
(-)psmisc/pkg-descr (-1 / +1 lines)
Lines 1-4 Link Here
1
A port of the Linux pstree, killall and pidof commands.
1
A port of the Linux pstree, killall and pidof commands.
2
Does not include the 'fuser' command.
2
Does not include the 'fuser' command.
3
3
4
WWW: http://psmisc.sourceforge.net
4
WWW: http://psmisc.sourceforge.net/

Return to bug 146709