From 30ce3b4c264c51c98f280e88e23792ff7deb2317 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Fri, 15 Oct 2021 09:03:04 +0200 Subject: New upstream version 3.1.1 --- linux/LinuxProcessList.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'linux/LinuxProcessList.c') diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index 8d82b00..dbbc57d 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -1,7 +1,7 @@ /* htop - LinuxProcessList.c (C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2, see the COPYING file +Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ @@ -58,6 +58,10 @@ in the source distribution for its full text. #include "LibSensors.h" #endif +#ifndef O_PATH +#define O_PATH 010000000 // declare for ancient glibc versions +#endif + static long long btime = -1; @@ -1236,8 +1240,8 @@ static bool LinuxProcessList_readCmdlineFile(Process* process, openat_arg_t proc if (amtRead > 0) { filename[amtRead] = 0; if (!process->procExe || - (!process->procExeDeleted && !String_eq(filename, process->procExe)) || - (process->procExeDeleted && !String_startsWith(filename, process->procExe))) { + (!process->procExeDeleted && !String_eq(filename, process->procExe)) || + process->procExeDeleted) { const char* deletedMarker = " (deleted)"; const size_t markerLen = strlen(deletedMarker); @@ -1605,7 +1609,7 @@ static inline void LinuxProcessList_scanMemoryInfo(ProcessList* this) { (variable) = parsed_; \ } \ break; \ - } + } else (void) 0 /* Require a ";" after the macro use. */ switch (buffer[0]) { case 'M': @@ -1781,12 +1785,12 @@ static inline void LinuxProcessList_scanZfsArcstats(LinuxProcessList* lpl) { if (String_startsWith(buffer, label)) { \ sscanf(buffer + strlen(label), " %*2u %32llu", variable); \ break; \ - } + } else (void) 0 /* Require a ";" after the macro use. */ #define tryReadFlag(label, variable, flag) \ if (String_startsWith(buffer, label)) { \ (flag) = sscanf(buffer + strlen(label), " %*2u %32llu", variable); \ break; \ - } + } else (void) 0 /* Require a ";" after the macro use. */ switch (buffer[0]) { case 'c': -- cgit v1.2.3