aboutsummaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python/python3-twisted/0001-initsendmsg-Return-NULL-on-error.patch
blob: d4cf34554157ae970a306cb88900d45ae45c77e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
From 890d039f067d52a0ab77b561d40da13f0c135634 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 3 Aug 2017 11:24:43 -0700
Subject: [PATCH] initsendmsg: Return NULL on error

Fixes a clang error

sendmsg.c:129:9: error: non-void function 'initsendmsg' should return a value [-Wreturn-type]

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 twisted/python/sendmsg.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/twisted/python/sendmsg.c b/twisted/python/sendmsg.c
index 9f2fd8c..9c080e1 100644
--- a/twisted/python/sendmsg.c
+++ b/twisted/python/sendmsg.c
@@ -126,7 +126,7 @@ PyMODINIT_FUNC initsendmsg(void) {
     module = Py_InitModule3("sendmsg", sendmsg_methods, sendmsg_doc);
 
     if (!module) {
-        return;
+        return NULL;
     }
 
     /*
@@ -135,39 +135,39 @@ PyMODINIT_FUNC initsendmsg(void) {
     */
 
     if (-1 == PyModule_AddIntConstant(module, "SCM_RIGHTS", SCM_RIGHTS)) {
-        return;
+        return NULL;
     }
 
 
     /* BSD, Darwin, Hurd */
 #if defined(SCM_CREDS)
     if (-1 == PyModule_AddIntConstant(module, "SCM_CREDS", SCM_CREDS)) {
-        return;
+        return NULL;
     }
 #endif
 
     /* Linux */
 #if defined(SCM_CREDENTIALS)
     if (-1 == PyModule_AddIntConstant(module, "SCM_CREDENTIALS", SCM_CREDENTIALS)) {
-        return;
+        return NULL;
     }
 #endif
 
     /* Apparently everywhere, but not standardized. */
 #if defined(SCM_TIMESTAMP)
     if (-1 == PyModule_AddIntConstant(module, "SCM_TIMESTAMP", SCM_TIMESTAMP)) {
-        return;
+        return NULL;
     }
 #endif
 
     module = PyImport_ImportModule("socket");
     if (!module) {
-        return;
+        return NULL;
     }
 
     sendmsg_socket_error = PyObject_GetAttrString(module, "error");
     if (!sendmsg_socket_error) {
-        return;
+        return NULL;
     }
 }
 
-- 
2.13.4