| 35 | } |
| 36 | |
| 37 | void UnixProcessInfo::readProcessInfo(int pid) |
| 38 | { |
| 39 | // prevent _arguments from growing longer and longer each time this |
| 40 | // method is called. |
| 41 | clearArguments(); |
| 42 | |
| 43 | if (readProcInfo(pid)) { |
| 44 | readArguments(pid); |
| 45 | readCurrentDir(pid); |
| 46 | |
| 47 | bool ok = false; |
| 48 | const QString &processNameString = name(&ok); |
| 49 | |
| 50 | if (ok && processNameString == QLatin1String("sudo")) { |
| 51 | // Append process name along with sudo |
| 52 | const QVector<QString> &args = arguments(&ok); |
| 53 | |
| 54 | if (ok && args.size() > 1) { |
| 55 | setName(processNameString + QStringLiteral(" ") + args[1]); |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | void UnixProcessInfo::readUserName() |
| 62 | { |