diff options
author | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2020-12-29 19:55:05 +0000 |
---|---|---|
committer | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2020-12-29 19:55:05 +0000 |
commit | f53120073b321c1d2e42641ca22414992ddbe0ff (patch) | |
tree | e36c5a9aca8c5065317baad18604bfa66968894e /contrib/bsnmp | |
parent | 916806472a8a245e8f2ddfeea4a1db652879a6f6 (diff) | |
download | src-f53120073b321c1d2e42641ca22414992ddbe0ff.tar.gz src-f53120073b321c1d2e42641ca22414992ddbe0ff.zip |
Revert "bsnmpclient(3): make it thread-safe"
This reverts commit 89e3d5671ba13dceca272d5b159c9bd805f3f504.
As pointed out, there are several problems with that commit:
1. The new semantics, while useful for clients where multiple
threads use separate contexts, breaks clients which correctly
share a single one
2. Change in semantics would require a library version bump
3. It doesn't build with GCC
Diffstat (limited to 'contrib/bsnmp')
-rw-r--r-- | contrib/bsnmp/lib/asn1.c | 2 | ||||
-rw-r--r-- | contrib/bsnmp/lib/snmpclient.c | 4 | ||||
-rw-r--r-- | contrib/bsnmp/lib/snmpclient.h | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/contrib/bsnmp/lib/asn1.c b/contrib/bsnmp/lib/asn1.c index a03dac70c529..f1f9267c0226 100644 --- a/contrib/bsnmp/lib/asn1.c +++ b/contrib/bsnmp/lib/asn1.c @@ -1019,7 +1019,7 @@ asn_oid2str_r(const struct asn_oid *oid, char *buf) char * asn_oid2str(const struct asn_oid *oid) { - __thread static char str[ASN_OIDSTRLEN]; + static char str[ASN_OIDSTRLEN]; return (asn_oid2str_r(oid, str)); } diff --git a/contrib/bsnmp/lib/snmpclient.c b/contrib/bsnmp/lib/snmpclient.c index e49105918416..c22d8e125a14 100644 --- a/contrib/bsnmp/lib/snmpclient.c +++ b/contrib/bsnmp/lib/snmpclient.c @@ -71,7 +71,7 @@ #define DEBUG_PARSE 0 /* global context */ -__thread struct snmp_client snmp_client; +struct snmp_client snmp_client; /* List of all outstanding requests */ struct sent_pdu { @@ -86,7 +86,7 @@ struct sent_pdu { }; LIST_HEAD(sent_pdu_list, sent_pdu); -__thread static struct sent_pdu_list sent_pdus; +static struct sent_pdu_list sent_pdus; /* * Prototype table entry. All C-structure produced by the table function must diff --git a/contrib/bsnmp/lib/snmpclient.h b/contrib/bsnmp/lib/snmpclient.h index 1bc3780de038..a19bdb2ea653 100644 --- a/contrib/bsnmp/lib/snmpclient.h +++ b/contrib/bsnmp/lib/snmpclient.h @@ -114,7 +114,7 @@ struct snmp_client { }; /* the global context */ -extern __thread struct snmp_client snmp_client; +extern struct snmp_client snmp_client; /* initizialies a snmp_client structure */ void snmp_client_init(struct snmp_client *); |