Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 1f79ba7

Browse files
committed
Merge pull request #2828 from stephentoub/fix_process_enumeration_linux
Fix process enumeration bug on Linux
2 parents 2985bcb + 3583434 commit 1f79ba7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Linux.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ private static ProcessInfo CreateProcessInfo(int pid)
9696
// arbitrary other processes.
9797
};
9898
}
99-
catch (FileNotFoundException)
99+
catch (IOException)
100100
{
101101
// Between the time that we get an ID and the time that we try to read the associated stat
102102
// file(s), the process could be gone.
@@ -128,8 +128,7 @@ private static ProcessInfo CreateProcessInfo(int pid)
128128
}
129129
}
130130
}
131-
catch (FileNotFoundException) { } // process and/or threads may go away by the time we try to read from them
132-
catch (DirectoryNotFoundException) { }
131+
catch (IOException) { } // process and/or threads may go away by the time we try to read from them
133132

134133
// Finally return what we've built up
135134
return pi;

0 commit comments

Comments
 (0)