Skip to content

Commit

Permalink
Use Path.GetFileName instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
2E0PGS committed Feb 3, 2019
1 parent 691e55e commit e1e308c
Showing 1 changed file with 1 addition and 2 deletions.
Expand Up @@ -127,12 +127,11 @@ internal static ProcessInfo CreateProcessInfo(int pid, ReusableTextReader reusab
internal static ProcessInfo CreateProcessInfo(Interop.procfs.ParsedStat procFsStat, ReusableTextReader reusableReader)
{
int pid = procFsStat.pid;
string[] fullPathArray = Process.GetExePath(pid).Split('\\');

var pi = new ProcessInfo()
{
ProcessId = pid,
ProcessName = fullPathArray.Last(),
ProcessName = Path.GetFileName(Process.GetExePath(pid)),
BasePriority = (int)procFsStat.nice,
VirtualBytes = (long)procFsStat.vsize,
WorkingSet = procFsStat.rss * Environment.SystemPageSize,
Expand Down

0 comments on commit e1e308c

Please sign in to comment.