summaryrefslogtreecommitdiff
path: root/procps/fuser.c
diff options
context:
space:
mode:
authorDenis Vlasenko2008-05-28 12:44:22 +0000
committerDenis Vlasenko2008-05-28 12:44:22 +0000
commit5de8a13b0888e6eb490e13cba2cca293ee8bc4ad (patch)
treea15e68384ee3d1e7d7f890d2e8529cbcf13ccdd3 /procps/fuser.c
parentea9f7a6a7fbc90c7dabd9c314199c73fd313e283 (diff)
downloadbusybox-5de8a13b0888e6eb490e13cba2cca293ee8bc4ad.zip
busybox-5de8a13b0888e6eb490e13cba2cca293ee8bc4ad.tar.gz
fiser: opendir "/proc", not "." (by Cristian Ionescu-Idbohrn)
Diffstat (limited to 'procps/fuser.c')
-rw-r--r--procps/fuser.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/procps/fuser.c b/procps/fuser.c
index fd876d5..663abe4 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,
return plist;
}
+/* NB: does chdir internally */
static pid_list *scan_proc_pids(inode_list *ilist)
{
DIR *d;
@@ -215,7 +216,7 @@ static pid_list *scan_proc_pids(inode_list *ilist)
pid_t pid;
pid_list *plist;
- d = opendir(".");
+ d = opendir("/proc");
if (!d)
return NULL;
@@ -329,7 +330,7 @@ Find processes which use FILEs or PORTs
pp++;
}
- plist = scan_proc_pids(ilist);
+ plist = scan_proc_pids(ilist); /* changes dir to "/proc" */
if (!plist)
return EXIT_FAILURE;