blob: 02a22e0af79d6ea5f98e6bfb2f31f739b92836e4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
--- busybox-1.10.2/procps/fuser.c Sat Apr 19 06:03:13 2008
+++ busybox-1.10.2-fuser/procps/fuser.c Wed May 28 16:53:35 2008
@@ -208,6 +208,7 @@
return plist;
}
+/* NB: does chdir internally */
static pid_list *scan_proc_pids(inode_list *ilist)
{
DIR *d;
@@ -215,7 +216,8 @@
pid_t pid;
pid_list *plist;
- d = opendir(".");
+ xchdir("/proc");
+ d = opendir("/proc");
if (!d)
return NULL;
@@ -329,7 +331,7 @@
pp++;
}
- plist = scan_proc_pids(ilist);
+ plist = scan_proc_pids(ilist); /* changes dir to "/proc" */
if (!plist)
return EXIT_FAILURE;
|