summaryrefslogtreecommitdiff
path: root/user/htop/correctness.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2020-01-14 10:08:19 +0000
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-01-14 10:08:19 +0000
commite70325e83d97d6cef9bd38f6c5e4e0a7af5dd6fc (patch)
tree4df05ec7d211d0ea00d087e5ef7e17f1eb56248f /user/htop/correctness.patch
parentcd33dc8f0ee48b00991e1b0f8833b8e65a8770d8 (diff)
downloadpackages-e70325e83d97d6cef9bd38f6c5e4e0a7af5dd6fc.tar.gz
packages-e70325e83d97d6cef9bd38f6c5e4e0a7af5dd6fc.tar.bz2
packages-e70325e83d97d6cef9bd38f6c5e4e0a7af5dd6fc.tar.xz
packages-e70325e83d97d6cef9bd38f6c5e4e0a7af5dd6fc.zip
user/*: Modernise / fix syntax / deps / code / tests
Diffstat (limited to 'user/htop/correctness.patch')
-rw-r--r--user/htop/correctness.patch78
1 files changed, 78 insertions, 0 deletions
diff --git a/user/htop/correctness.patch b/user/htop/correctness.patch
new file mode 100644
index 000000000..51a9848d2
--- /dev/null
+++ b/user/htop/correctness.patch
@@ -0,0 +1,78 @@
+From: Jonathan Currier <dullfire@yahoo.com>
+
+diff --git a/MainPanel.h b/MainPanel.h
+index 8849659..471870b 100644
+--- a/MainPanel.h
++++ b/MainPanel.h
+@@ -12,6 +12,7 @@ in the source distribution for its full text.
+ #include "Panel.h"
+ #include "Action.h"
+ #include "Settings.h"
++#include "union-arg.h"
+
+ typedef struct MainPanel_ {
+ Panel super;
+@@ -21,11 +22,6 @@ typedef struct MainPanel_ {
+ pid_t pidSearch;
+ } MainPanel;
+
+-typedef union {
+- int i;
+- void* v;
+-} Arg;
+-
+ typedef bool(*MainPanel_ForeachProcessFn)(Process*, Arg);
+
+ #define MainPanel_getFunctionBar(this_) (((Panel*)(this_))->defaultBar)
+diff --git a/Process.c b/Process.c
+index 471f529..ae617a6 100644
+--- a/Process.c
++++ b/Process.c
+@@ -548,7 +548,9 @@ bool Process_changePriorityBy(Process* this, int delta) {
+ return Process_setPriority(this, this->nice + delta);
+ }
+
+-void Process_sendSignal(Process* this, int sgn) {
++
++void Process_sendSignal(Process* this, Arg arg) {
++ int sgn = arg.i;
+ CRT_dropPrivileges();
+ kill(this->pid, (int) sgn);
+ CRT_restorePrivileges();
+diff --git a/Process.h b/Process.h
+index f702ca0..3011845 100644
+--- a/Process.h
++++ b/Process.h
+@@ -29,6 +29,7 @@ in the source distribution for its full text.
+ #include "Object.h"
+
+ #include <sys/types.h>
++#include "union-arg.h"
+
+ #define PROCESS_FLAG_IO 0x0001
+
+@@ -199,7 +200,7 @@ bool Process_setPriority(Process* this, int priority);
+
+ bool Process_changePriorityBy(Process* this, int delta);
+
+-void Process_sendSignal(Process* this, int sgn);
++void Process_sendSignal(Process* this, Arg arg);
+
+ long Process_pidCompare(const void* v1, const void* v2);
+
+diff --git a/union-arg.h b/union-arg.h
+new file mode 100644
+index 0000000..5c8a094
+--- /dev/null
++++ b/union-arg.h
+@@ -0,0 +1,9 @@
++#ifndef UNION_ARG_HEADER
++#define UNION_ARG_HEADER
++
++typedef union {
++ int i;
++ void* v;
++} Arg;
++
++#endif
+