mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 17:31:58 -05:00
Fix busted display of tty names in /proc/summary.
This commit is contained in:
parent
a8f36f72a8
commit
d980ddc745
4 changed files with 17 additions and 2 deletions
|
@ -3,6 +3,7 @@
|
||||||
#include <VirtualFileSystem/VirtualFileSystem.h>
|
#include <VirtualFileSystem/VirtualFileSystem.h>
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
#include "MemoryManager.h"
|
#include "MemoryManager.h"
|
||||||
|
#include "StdLib.h"
|
||||||
|
|
||||||
static ProcFileSystem* s_the;
|
static ProcFileSystem* s_the;
|
||||||
|
|
||||||
|
@ -210,7 +211,7 @@ ByteBuffer procfs$summary()
|
||||||
task->parentPID(),
|
task->parentPID(),
|
||||||
task->timesScheduled(),
|
task->timesScheduled(),
|
||||||
task->fileHandleCount(),
|
task->fileHandleCount(),
|
||||||
task->tty() ? task->tty()->ttyName().characters() : "n/a",
|
task->tty() ? strrchr(task->tty()->ttyName().characters(), '/') + 1 : "n/a",
|
||||||
task->name().characters());
|
task->name().characters());
|
||||||
}
|
}
|
||||||
*ptr = '\0';
|
*ptr = '\0';
|
||||||
|
|
|
@ -24,6 +24,17 @@ void* memset(void* dest, BYTE c, DWORD n)
|
||||||
return dest;
|
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 strlen(const char* str)
|
||||||
{
|
{
|
||||||
DWORD len = 0;
|
DWORD len = 0;
|
||||||
|
|
|
@ -19,3 +19,4 @@ DWORD strlen(const char*);
|
||||||
void *memset(void*, BYTE, DWORD);
|
void *memset(void*, BYTE, DWORD);
|
||||||
char *strdup(const char*);
|
char *strdup(const char*);
|
||||||
int memcmp(const void*, const void*, size_t);
|
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
|
cp -p _fs_contents.stock _fs_contents
|
||||||
mkdir mnt
|
mkdir -p mnt
|
||||||
mount -o loop _fs_contents mnt/
|
mount -o loop _fs_contents mnt/
|
||||||
cp -R ../Base/* mnt/
|
cp -R ../Base/* mnt/
|
||||||
cp ../Userland/sh mnt/bin/sh
|
cp ../Userland/sh mnt/bin/sh
|
||||||
|
|
Loading…
Reference in a new issue