summaryrefslogtreecommitdiffstats
path: root/linux
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2020-08-20 09:35:24 +1000
committerNathan Scott <nathans@redhat.com>2020-08-20 09:35:33 +1000
commit500fb283e9b86a6580cedbf834aea9d7dd639a66 (patch)
tree52c0df7aa5178887f14e48fc40c1dc45a8530dfc /linux
parent5228f5d47a10d9194297a31bf4cf7dbbade6c868 (diff)
Resolve compiler warnings and errors relating to the Arg union
Promote the Arg union to a core data type in Object.c such that it is visible everywhere (many source files need it), and correct declarations of several functions that use it. The Process_sendSignal function is also corrected to have the expected return type (bool, not void) - an error being masked by ignoring this not-quite-harmless warning. I've also added error checking to the kill(2) call here, which was previously overlooked / missing (?).
Diffstat (limited to 'linux')
-rw-r--r--linux/LinuxProcess.c7
-rw-r--r--linux/LinuxProcess.h3
2 files changed, 6 insertions, 4 deletions
diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c
index 76f42394..70c3b5d1 100644
--- a/linux/LinuxProcess.c
+++ b/linux/LinuxProcess.c
@@ -1,6 +1,7 @@
/*
htop - LinuxProcess.c
(C) 2014 Hisham H. Muhammad
+(C) 2020 Red Hat, Inc. All Rights Reserved.
Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
@@ -314,12 +315,12 @@ IOPriority LinuxProcess_updateIOPriority(LinuxProcess* this) {
return ioprio;
}
-bool LinuxProcess_setIOPriority(LinuxProcess* this, IOPriority ioprio) {
+bool LinuxProcess_setIOPriority(LinuxProcess* this, Arg ioprio) {
// Other OSes masquerading as Linux (NetBSD?) don't have this syscall
#ifdef SYS_ioprio_set
- syscall(SYS_ioprio_set, IOPRIO_WHO_PROCESS, this->super.pid, ioprio);
+ syscall(SYS_ioprio_set, IOPRIO_WHO_PROCESS, this->super.pid, ioprio.i);
#endif
- return (LinuxProcess_updateIOPriority(this) == ioprio);
+ return (LinuxProcess_updateIOPriority(this) == ioprio.i);
}
#ifdef HAVE_DELAYACCT
diff --git a/linux/LinuxProcess.h b/linux/LinuxProcess.h
index f9984330..44ae91c1 100644
--- a/linux/LinuxProcess.h
+++ b/linux/LinuxProcess.h
@@ -5,6 +5,7 @@
/*
htop - LinuxProcess.h
(C) 2014 Hisham H. Muhammad
+(C) 2020 Red Hat, Inc. All Rights Reserved.
Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
@@ -176,7 +177,7 @@ extern io_priority;
extern IOPriority LinuxProcess_updateIOPriority(LinuxProcess* this);
-extern bool LinuxProcess_setIOPriority(LinuxProcess* this, IOPriority ioprio);
+extern bool LinuxProcess_setIOPriority(LinuxProcess* this, Arg ioprio);
#ifdef HAVE_DELAYACCT
extern void LinuxProcess_printDelay(float delay_percent, char* buffer, int n);

© 2014-2024 Faster IT GmbH | imprint | privacy policy