From 8e11f1f6568252792905b5123ed98b842a648788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Mon, 17 Apr 2023 19:04:05 +0200 Subject: Linux: rename variable for clearer intent Make it more clear the variable stores the previous tty number (similar to lasttimes), while the current one gets set in the intermediate LinuxProcessTable_readStatFile(). --- linux/LinuxProcessTable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/LinuxProcessTable.c b/linux/LinuxProcessTable.c index 039a64ec..1799ffa7 100644 --- a/linux/LinuxProcessTable.c +++ b/linux/LinuxProcessTable.c @@ -1495,7 +1495,7 @@ static bool LinuxProcessTable_recurseProcTree(LinuxProcessTable* this, openat_ar char statCommand[MAX_NAME + 1]; unsigned long long int lasttimes = (lp->utime + lp->stime); - unsigned long int tty_nr = proc->tty_nr; + unsigned long int last_tty_nr = proc->tty_nr; if (!LinuxProcessTable_readStatFile(lp, procFd, lhost, scanMainThread, statCommand, sizeof(statCommand))) goto errorReadingProcess; @@ -1503,7 +1503,7 @@ static bool LinuxProcessTable_recurseProcTree(LinuxProcessTable* this, openat_ar proc->isKernelThread = true; } - if (tty_nr != proc->tty_nr && this->ttyDrivers) { + if (last_tty_nr != proc->tty_nr && this->ttyDrivers) { free(proc->tty_name); proc->tty_name = LinuxProcessTable_updateTtyDevice(this->ttyDrivers, proc->tty_nr); } -- cgit v1.2.3