diff --git a/Kernel/ProcFileSystem.cpp b/Kernel/ProcFileSystem.cpp index ff8495a7235..64b2e6dc35a 100644 --- a/Kernel/ProcFileSystem.cpp +++ b/Kernel/ProcFileSystem.cpp @@ -3,6 +3,7 @@ #include #include "system.h" #include "MemoryManager.h" +#include "StdLib.h" static ProcFileSystem* s_the; @@ -210,7 +211,7 @@ ByteBuffer procfs$summary() task->parentPID(), task->timesScheduled(), task->fileHandleCount(), - task->tty() ? task->tty()->ttyName().characters() : "n/a", + task->tty() ? strrchr(task->tty()->ttyName().characters(), '/') + 1 : "n/a", task->name().characters()); } *ptr = '\0'; diff --git a/Kernel/StdLib.cpp b/Kernel/StdLib.cpp index d872da6d2f7..bbdf421c63e 100644 --- a/Kernel/StdLib.cpp +++ b/Kernel/StdLib.cpp @@ -24,6 +24,17 @@ void* memset(void* dest, BYTE c, DWORD n) return dest; } +char* strrchr(const char* str, int ch) +{ + char *last = nullptr; + char c; + for (; (c = *str); ++str) { + if (c == ch) + last = (char*)str; + } + return last; +} + DWORD strlen(const char* str) { DWORD len = 0; diff --git a/Kernel/StdLib.h b/Kernel/StdLib.h index ee7cd18c339..112aa8dad62 100644 --- a/Kernel/StdLib.h +++ b/Kernel/StdLib.h @@ -19,3 +19,4 @@ DWORD strlen(const char*); void *memset(void*, BYTE, DWORD); char *strdup(const char*); int memcmp(const void*, const void*, size_t); +char* strrchr(const char* str, int ch); diff --git a/Kernel/sync.sh b/Kernel/sync.sh index 8a16e5329a2..ae4d5b03ec5 100755 --- a/Kernel/sync.sh +++ b/Kernel/sync.sh @@ -1,5 +1,7 @@ +rm -f _fs_contents.lock +rm -f _fs_contents cp -p _fs_contents.stock _fs_contents -mkdir mnt +mkdir -p mnt mount -o loop _fs_contents mnt/ cp -R ../Base/* mnt/ cp ../Userland/sh mnt/bin/sh