termux-packages/packages/qemu-system-x86_64-headless/0006-add-missing-sigorset.p...

32 lines
944 B
Diff
Raw Normal View History

2019-12-17 13:54:39 +01:00
diff -uNr qemu-4.2.0/linux-user/signal.c qemu-4.2.0.mod/linux-user/signal.c
--- qemu-4.2.0/linux-user/signal.c 2019-12-12 20:20:48.000000000 +0200
+++ qemu-4.2.0.mod/linux-user/signal.c 2019-12-15 00:15:27.954549467 +0200
@@ -182,6 +182,27 @@
return atomic_xchg(&ts->signal_pending, 1);
}
+#ifdef _NSIG_WORDS
+static int sigorset(sigset_t *dest, const sigset_t *a, const sigset_t *b)
+{
+ int i;
+ if (!dest || !a || !b)
+ return -1;
+ for (i = 0; i < _NSIG_WORDS; i++)
+ dest->sig[i] = a->sig[i] | b->sig[i];
+ return 0;
+}
+#else
+static int sigorset(sigset_t *dest, const sigset_t *a, const sigset_t *b)
+{
+ int i;
+ if (!dest || !a || !b)
+ return -1;
+ *dest = *a | *b;
+ return 0;
+}
+#endif
+
/* Wrapper for sigprocmask function
* Emulates a sigprocmask in a safe way for the guest. Note that set and oldset
* are host signal set, not guest ones. Returns -TARGET_ERESTARTSYS if