aboutsummaryrefslogtreecommitdiff
path: root/procps
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-05-28 12:44:22 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-05-28 12:44:22 +0000
commit5de8a13b0888e6eb490e13cba2cca293ee8bc4ad (patch)
treea15e68384ee3d1e7d7f890d2e8529cbcf13ccdd3 /procps
parentea9f7a6a7fbc90c7dabd9c314199c73fd313e283 (diff)
downloadbusybox-w32-5de8a13b0888e6eb490e13cba2cca293ee8bc4ad.tar.gz
busybox-w32-5de8a13b0888e6eb490e13cba2cca293ee8bc4ad.tar.bz2
busybox-w32-5de8a13b0888e6eb490e13cba2cca293ee8bc4ad.zip
fiser: opendir "/proc", not "." (by Cristian Ionescu-Idbohrn)
Diffstat (limited to 'procps')
-rw-r--r--procps/fuser.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/procps/fuser.c b/procps/fuser.c
index fd876d559..663abe478 100644
--- a/procps/fuser.c
+++ b/procps/fuser.c
@@ -208,6 +208,7 @@ static pid_list *scan_dir_links(const char *dname, pid_t pid,
208 return plist; 208 return plist;
209} 209}
210 210
211/* NB: does chdir internally */
211static pid_list *scan_proc_pids(inode_list *ilist) 212static pid_list *scan_proc_pids(inode_list *ilist)
212{ 213{
213 DIR *d; 214 DIR *d;
@@ -215,7 +216,7 @@ static pid_list *scan_proc_pids(inode_list *ilist)
215 pid_t pid; 216 pid_t pid;
216 pid_list *plist; 217 pid_list *plist;
217 218
218 d = opendir("."); 219 d = opendir("/proc");
219 if (!d) 220 if (!d)
220 return NULL; 221 return NULL;
221 222
@@ -329,7 +330,7 @@ Find processes which use FILEs or PORTs
329 pp++; 330 pp++;
330 } 331 }
331 332
332 plist = scan_proc_pids(ilist); 333 plist = scan_proc_pids(ilist); /* changes dir to "/proc" */
333 334
334 if (!plist) 335 if (!plist)
335 return EXIT_FAILURE; 336 return EXIT_FAILURE;