summaryrefslogtreecommitdiff
path: root/procps
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-04-19 04:05:28 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-04-19 04:05:28 +0000
commitfc9fc1f9292861cd1621d884338a766289acdf4a (patch)
tree0a2b0dd81d994e73f77174665dfb3e68e611471e /procps
parent74f8208f1896ceb2828a84d93999584a8407565b (diff)
downloadbusybox-w32-fc9fc1f9292861cd1621d884338a766289acdf4a.tar.gz
busybox-w32-fc9fc1f9292861cd1621d884338a766289acdf4a.tar.bz2
busybox-w32-fc9fc1f9292861cd1621d884338a766289acdf4a.zip
apply all post 1.10.0 fixes
bump version to 1.10.1
Diffstat (limited to 'procps')
-rw-r--r--procps/fuser.c10
-rw-r--r--procps/top.c7
2 files changed, 10 insertions, 7 deletions
diff --git a/procps/fuser.c b/procps/fuser.c
index 48c9bdc1e..fd876d559 100644
--- a/procps/fuser.c
+++ b/procps/fuser.c
@@ -57,11 +57,11 @@ static int file_to_dev_inode(const char *filename, dev_t *dev, ino_t *inode)
57 57
58static char *parse_net_arg(const char *arg, unsigned *port) 58static char *parse_net_arg(const char *arg, unsigned *port)
59{ 59{
60 char path[12], tproto[5]; 60 char path[20], tproto[5];
61 61
62 if (sscanf(arg, "%u/%4s", port, tproto) != 2) 62 if (sscanf(arg, "%u/%4s", port, tproto) != 2)
63 return NULL; 63 return NULL;
64 sprintf(path, "net/%s", tproto); 64 sprintf(path, "/proc/net/%s", tproto);
65 if (access(path, R_OK) != 0) 65 if (access(path, R_OK) != 0)
66 return NULL; 66 return NULL;
67 return xstrdup(tproto); 67 return xstrdup(tproto);
@@ -99,7 +99,7 @@ static inode_list *add_inode(inode_list *ilist, dev_t dev, ino_t inode)
99static inode_list *scan_proc_net(const char *proto, 99static inode_list *scan_proc_net(const char *proto,
100 unsigned port, inode_list *ilist) 100 unsigned port, inode_list *ilist)
101{ 101{
102 char path[12], line[MAX_LINE + 1]; 102 char path[20], line[MAX_LINE + 1];
103 char addr[128]; 103 char addr[128];
104 ino_t tmp_inode; 104 ino_t tmp_inode;
105 dev_t tmp_dev; 105 dev_t tmp_dev;
@@ -109,7 +109,7 @@ static inode_list *scan_proc_net(const char *proto,
109 109
110 tmp_dev = find_socket_dev(); 110 tmp_dev = find_socket_dev();
111 111
112 sprintf(path, "net/%s", proto); 112 sprintf(path, "/proc/net/%s", proto);
113 f = fopen(path, "r"); 113 f = fopen(path, "r");
114 if (!f) 114 if (!f)
115 return ilist; 115 return ilist;
@@ -314,8 +314,6 @@ Find processes which use FILEs or PORTs
314 opt = getopt32(argv, OPTION_STRING); 314 opt = getopt32(argv, OPTION_STRING);
315 argv += optind; 315 argv += optind;
316 316
317 xchdir("/proc");
318
319 ilist = NULL; 317 ilist = NULL;
320 pp = argv; 318 pp = argv;
321 while (*pp) { 319 while (*pp) {
diff --git a/procps/top.c b/procps/top.c
index e3f91c8f9..206f9e8be 100644
--- a/procps/top.c
+++ b/procps/top.c
@@ -861,17 +861,22 @@ int top_main(int argc ATTRIBUTE_UNUSED, char **argv)
861#else 861#else
862 qsort(top, ntop, sizeof(top_status_t), (void*)(sort_function[0])); 862 qsort(top, ntop, sizeof(top_status_t), (void*)(sort_function[0]));
863#endif /* FEATURE_TOP_CPU_USAGE_PERCENTAGE */ 863#endif /* FEATURE_TOP_CPU_USAGE_PERCENTAGE */
864 } else { /* TOPMEM */ 864 }
865#if ENABLE_FEATURE_TOPMEM
866 else { /* TOPMEM */
865 qsort(topmem, ntop, sizeof(topmem_status_t), (void*)topmem_sort); 867 qsort(topmem, ntop, sizeof(topmem_status_t), (void*)topmem_sort);
866 } 868 }
869#endif
867 count = lines; 870 count = lines;
868 if (OPT_BATCH_MODE || count > ntop) { 871 if (OPT_BATCH_MODE || count > ntop) {
869 count = ntop; 872 count = ntop;
870 } 873 }
871 if (scan_mask == TOP_MASK) 874 if (scan_mask == TOP_MASK)
872 display_process_list(count, col); 875 display_process_list(count, col);
876#if ENABLE_FEATURE_TOPMEM
873 else 877 else
874 display_topmem_process_list(count, col); 878 display_topmem_process_list(count, col);
879#endif
875 clearmems(); 880 clearmems();
876 if (iterations >= 0 && !--iterations) 881 if (iterations >= 0 && !--iterations)
877 break; 882 break;