From 67e368914a1b03cbf18c4c7b678f424f5e18ad2e Mon Sep 17 00:00:00 2001 From: Lion Yang Date: Sat, 25 Aug 2018 21:15:59 +0800 Subject: [PATCH 1/2] htop.c: remove unused "--io" / "-i" (#811) Introduced from https://github.com/hishamhm/htop/commit/3383d8e5561dfc6fb2b65e0a194df94ccb5e08af (2.0.0) but never used. --- htop.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htop.c b/htop.c index 678a3b8a..8c88c782 100644 --- a/htop.c +++ b/htop.c @@ -87,13 +87,12 @@ static CommandLineSettings parseArguments(int argc, char** argv) { {"no-colour",no_argument, 0, 'C'}, {"tree", no_argument, 0, 't'}, {"pid", required_argument, 0, 'p'}, - {"io", no_argument, 0, 'i'}, {0,0,0,0} }; int opt, opti=0; /* Parse arguments */ - while ((opt = getopt_long(argc, argv, "hvCs:td:u:p:i", long_opts, &opti))) { + while ((opt = getopt_long(argc, argv, "hvCs:td:u:p:", long_opts, &opti))) { if (opt == EOF) break; switch (opt) { case 'h': From c34be41e1ca89e81e43cfe3be01b52478461f70e Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Sun, 7 Oct 2018 11:16:12 +0200 Subject: [PATCH 2/2] Widen ST_UID (UID) column to 5 chars to allow UIDs > 9999 without breaking alignment Issue Github #841, Debian bug #910492 --- Process.c | 2 +- darwin/Platform.c | 2 +- dragonflybsd/DragonFlyBSDProcess.c | 2 +- freebsd/FreeBSDProcess.c | 2 +- linux/LinuxProcess.c | 2 +- openbsd/OpenBSDProcess.c | 2 +- solaris/SolarisProcess.c | 2 +- unsupported/Platform.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Process.c b/Process.c index 471f5299..d57a2e97 100644 --- a/Process.c +++ b/Process.c @@ -466,7 +466,7 @@ void Process_writeField(Process* this, RichString* str, ProcessField field) { } break; } - case ST_UID: xSnprintf(buffer, n, "%4d ", this->st_uid); break; + case ST_UID: xSnprintf(buffer, n, "%5d ", this->st_uid); break; case TIME: Process_printTime(str, this->time); return; case TGID: xSnprintf(buffer, n, Process_pidFormat, this->tgid); break; case TPGID: xSnprintf(buffer, n, Process_pidFormat, this->tpgid); break; diff --git a/darwin/Platform.c b/darwin/Platform.c index 1dce8b67..27a7b850 100644 --- a/darwin/Platform.c +++ b/darwin/Platform.c @@ -90,7 +90,7 @@ ProcessFieldData Process_fields[] = { [PROCESSOR] = { .name = "PROCESSOR", .title = "CPU ", .description = "Id of the CPU the process last executed on", .flags = 0, }, [M_SIZE] = { .name = "M_SIZE", .title = " VIRT ", .description = "Total program size in virtual memory", .flags = 0, }, [M_RESIDENT] = { .name = "M_RESIDENT", .title = " RES ", .description = "Resident set size, size of the text and data sections, plus stack usage", .flags = 0, }, - [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, + [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, }, [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, }, [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, diff --git a/dragonflybsd/DragonFlyBSDProcess.c b/dragonflybsd/DragonFlyBSDProcess.c index dade106d..b7ef01d0 100644 --- a/dragonflybsd/DragonFlyBSDProcess.c +++ b/dragonflybsd/DragonFlyBSDProcess.c @@ -74,7 +74,7 @@ ProcessFieldData Process_fields[] = { [PROCESSOR] = { .name = "PROCESSOR", .title = "CPU ", .description = "Id of the CPU the process last executed on", .flags = 0, }, [M_SIZE] = { .name = "M_SIZE", .title = " VIRT ", .description = "Total program size in virtual memory", .flags = 0, }, [M_RESIDENT] = { .name = "M_RESIDENT", .title = " RES ", .description = "Resident set size, size of the text and data sections, plus stack usage", .flags = 0, }, - [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, + [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, }, [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, }, [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, diff --git a/freebsd/FreeBSDProcess.c b/freebsd/FreeBSDProcess.c index f81fadf5..73bba192 100644 --- a/freebsd/FreeBSDProcess.c +++ b/freebsd/FreeBSDProcess.c @@ -73,7 +73,7 @@ ProcessFieldData Process_fields[] = { [PROCESSOR] = { .name = "PROCESSOR", .title = "CPU ", .description = "Id of the CPU the process last executed on", .flags = 0, }, [M_SIZE] = { .name = "M_SIZE", .title = " VIRT ", .description = "Total program size in virtual memory", .flags = 0, }, [M_RESIDENT] = { .name = "M_RESIDENT", .title = " RES ", .description = "Resident set size, size of the text and data sections, plus stack usage", .flags = 0, }, - [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, + [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, }, [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, }, [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c index 5f697078..b55d322c 100644 --- a/linux/LinuxProcess.c +++ b/linux/LinuxProcess.c @@ -203,7 +203,7 @@ ProcessFieldData Process_fields[] = { [M_DRS] = { .name = "M_DRS", .title = " DATA ", .description = "Size of the data segment plus stack usage of the process", .flags = 0, }, [M_LRS] = { .name = "M_LRS", .title = " LIB ", .description = "The library size of the process", .flags = 0, }, [M_DT] = { .name = "M_DT", .title = " DIRTY ", .description = "Size of the dirty pages of the process", .flags = 0, }, - [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, + [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, }, [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, }, [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, diff --git a/openbsd/OpenBSDProcess.c b/openbsd/OpenBSDProcess.c index 70f9653b..f54c9111 100644 --- a/openbsd/OpenBSDProcess.c +++ b/openbsd/OpenBSDProcess.c @@ -135,7 +135,7 @@ ProcessFieldData Process_fields[] = { .flags = 0, }, [ST_UID] = { .name = "ST_UID", - .title = " UID ", + .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, [PERCENT_CPU] = { diff --git a/solaris/SolarisProcess.c b/solaris/SolarisProcess.c index 31f488ef..514453fd 100644 --- a/solaris/SolarisProcess.c +++ b/solaris/SolarisProcess.c @@ -90,7 +90,7 @@ ProcessFieldData Process_fields[] = { [PROCESSOR] = { .name = "PROCESSOR", .title = "CPU ", .description = "Id of the CPU the process last executed on", .flags = 0, }, [M_SIZE] = { .name = "M_SIZE", .title = " VIRT ", .description = "Total program size in virtual memory", .flags = 0, }, [M_RESIDENT] = { .name = "M_RESIDENT", .title = " RES ", .description = "Resident set size, size of the text and data sections, plus stack usage", .flags = 0, }, - [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, + [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, }, [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, }, [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, diff --git a/unsupported/Platform.c b/unsupported/Platform.c index ba844191..e4c0e8ce 100644 --- a/unsupported/Platform.c +++ b/unsupported/Platform.c @@ -50,7 +50,7 @@ ProcessFieldData Process_fields[] = { [PROCESSOR] = { .name = "PROCESSOR", .title = "CPU ", .description = "Id of the CPU the process last executed on", .flags = 0, }, [M_SIZE] = { .name = "M_SIZE", .title = " VIRT ", .description = "Total program size in virtual memory", .flags = 0, }, [M_RESIDENT] = { .name = "M_RESIDENT", .title = " RES ", .description = "Resident set size, size of the text and data sections, plus stack usage", .flags = 0, }, - [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, + [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, }, [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, }, [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, },