aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;