mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-12 09:20:36 +00:00
Fix busted display of tty names in /proc/summary.
This commit is contained in:
parent
a8f36f72a8
commit
d980ddc745
Notes:
sideshowbarker
2024-07-19 18:35:29 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/d980ddc7458
4 changed files with 17 additions and 2 deletions
|
@ -3,6 +3,7 @@
|
|||
#include <VirtualFileSystem/VirtualFileSystem.h>
|
||||
#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';
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue