]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-31904: Adapt the _signal module to VxWorks RTOS (GH-12304)
authorpxinwr <peixing.xin@windriver.com>
Wed, 13 Mar 2019 17:18:25 +0000 (01:18 +0800)
committerVictor Stinner <vstinner@redhat.com>
Wed, 13 Mar 2019 17:18:25 +0000 (18:18 +0100)
Limited signal fields in VxWorks.

Misc/NEWS.d/next/Library/2019-03-13-14-55-02.bpo-31904.834kfY.rst [new file with mode: 0644]
Modules/signalmodule.c

diff --git a/Misc/NEWS.d/next/Library/2019-03-13-14-55-02.bpo-31904.834kfY.rst b/Misc/NEWS.d/next/Library/2019-03-13-14-55-02.bpo-31904.834kfY.rst
new file mode 100644 (file)
index 0000000..d859446
--- /dev/null
@@ -0,0 +1 @@
+Add _signal module support for VxWorks.
index f29720bcaf3637e18dec23c914c00dd33cacb994..4590017c170a524073afb4b645290153921f7f6f 100644 (file)
@@ -1079,11 +1079,18 @@ fill_siginfo(siginfo_t *si)
 
     PyStructSequence_SET_ITEM(result, 0, PyLong_FromLong((long)(si->si_signo)));
     PyStructSequence_SET_ITEM(result, 1, PyLong_FromLong((long)(si->si_code)));
+#ifdef __VXWORKS__   
+    PyStructSequence_SET_ITEM(result, 2, PyLong_FromLong(0L));
+    PyStructSequence_SET_ITEM(result, 3, PyLong_FromLong(0L));
+    PyStructSequence_SET_ITEM(result, 4, PyLong_FromLong(0L));
+    PyStructSequence_SET_ITEM(result, 5, PyLong_FromLong(0L));
+#else   
     PyStructSequence_SET_ITEM(result, 2, PyLong_FromLong((long)(si->si_errno)));
     PyStructSequence_SET_ITEM(result, 3, PyLong_FromPid(si->si_pid));
     PyStructSequence_SET_ITEM(result, 4, _PyLong_FromUid(si->si_uid));
     PyStructSequence_SET_ITEM(result, 5,
                                 PyLong_FromLong((long)(si->si_status)));
+#endif   
 #ifdef HAVE_SIGINFO_T_SI_BAND
     PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(si->si_band));
 #else