summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2019-01-21 22:32:13 +0200
committerToomas Soome <tsoome@me.com>2019-07-03 08:37:12 +0300
commit0daffde01c432cf3f4cc2fcc06e4e415e531b5a6 (patch)
treef47c0dca1dad23c146215ec72a77644c9a44dff2
parentd03c6e695aa047219c5b8a31d9b7d2f4ce431765 (diff)
downloadillumos-joyent-0daffde01c432cf3f4cc2fcc06e4e415e531b5a6.tar.gz
11126 libslp: NULL pointer errors
Reviewed by: John Levon <john.levon@joyent.com> Approved by: Richard Lowe <richlowe@richlowe.net>
-rw-r--r--usr/src/lib/libslp/clib/SLPOpen.c6
-rw-r--r--usr/src/lib/libslp/clib/SLPReg.c4
-rw-r--r--usr/src/lib/libslp/clib/slp_da_cache.c4
-rw-r--r--usr/src/lib/libslp/clib/slp_ipc.c4
-rw-r--r--usr/src/lib/libslp/clib/slp_net.c8
-rw-r--r--usr/src/lib/libslp/clib/slp_queue.c4
6 files changed, 9 insertions, 21 deletions
diff --git a/usr/src/lib/libslp/clib/SLPOpen.c b/usr/src/lib/libslp/clib/SLPOpen.c
index 6eb5696f51..0f95e8c16f 100644
--- a/usr/src/lib/libslp/clib/SLPOpen.c
+++ b/usr/src/lib/libslp/clib/SLPOpen.c
@@ -24,8 +24,6 @@
* All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
#include <stdlib.h>
#include <thread.h>
@@ -50,8 +48,8 @@ SLPError SLPOpen(const char *pcLang, SLPBoolean isAsync, SLPHandle *phSLP) {
/* initialize outcall synchronization */
hp->pending_outcall = SLP_FALSE;
- (void) mutex_init(&(hp->outcall_lock), NULL, NULL);
- (void) cond_init(&(hp->outcall_cv), NULL, NULL);
+ (void) mutex_init(&(hp->outcall_lock), USYNC_THREAD, NULL);
+ (void) cond_init(&(hp->outcall_cv), USYNC_THREAD, NULL);
hp->close_on_end = SLP_FALSE;
hp->consumer_tid = 0;
diff --git a/usr/src/lib/libslp/clib/SLPReg.c b/usr/src/lib/libslp/clib/SLPReg.c
index bce1ea4f6b..fafe813c74 100644
--- a/usr/src/lib/libslp/clib/SLPReg.c
+++ b/usr/src/lib/libslp/clib/SLPReg.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* This file contains all functions pertaining to registrations:
* SLPReg
@@ -565,7 +563,7 @@ static SLPError start_reg_thr() {
/* start the reg thread */
if ((terr = thr_create(
- 0, NULL, (void *(*)(void *)) reg_thread,
+ 0, 0, (void *(*)(void *)) reg_thread,
NULL, 0, NULL)) != 0) {
slp_err(LOG_CRIT, 0, "start_reg_thr",
"could not start thread: %s",
diff --git a/usr/src/lib/libslp/clib/slp_da_cache.c b/usr/src/lib/libslp/clib/slp_da_cache.c
index cd3acef489..a38fb45501 100644
--- a/usr/src/lib/libslp/clib/slp_da_cache.c
+++ b/usr/src/lib/libslp/clib/slp_da_cache.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* This module contains a cache used to optimized scope and DA
* discovery. Entries live for a short duration only (about 10 seconds),
@@ -226,7 +224,7 @@ static SLPError start_cache_thr() {
(void) cond_init(&cache_called_cond, 0, NULL);
if ((terr = thr_create(
- 0, NULL, (void *(*)(void *)) cache_thr,
+ 0, 0, (void *(*)(void *)) cache_thr,
NULL, 0, NULL)) != 0) {
slp_err(LOG_CRIT, 0, "start_cache_thr",
"could not start thread: %s", strerror(terr));
diff --git a/usr/src/lib/libslp/clib/slp_ipc.c b/usr/src/lib/libslp/clib/slp_ipc.c
index fcdacd8d5d..9449c8ecf6 100644
--- a/usr/src/lib/libslp/clib/slp_ipc.c
+++ b/usr/src/lib/libslp/clib/slp_ipc.c
@@ -24,8 +24,6 @@
* All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
@@ -118,7 +116,7 @@ static SLPError open_ipc() {
/* We now know slpd is reachable; start the management thread */
if (!ipc_thr_running) {
if ((terr = thr_create(
- 0, NULL,
+ 0, 0,
(void *(*)(void *)) ipc_manage_thr,
NULL, 0, NULL)) != 0) {
slp_err(LOG_CRIT, 0, "slp_open_ipc",
diff --git a/usr/src/lib/libslp/clib/slp_net.c b/usr/src/lib/libslp/clib/slp_net.c
index a32ae02a30..2a1fc64472 100644
--- a/usr/src/lib/libslp/clib/slp_net.c
+++ b/usr/src/lib/libslp/clib/slp_net.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Module for all network transactions. SLP messages can be multicast,
* unicast over UDP, or unicast over TCP; this module provides routines
@@ -136,7 +134,7 @@ void slp_uc_tcp_send(slp_handle_impl_t *hp, slp_target_t *target,
"out of memory");
return;
}
- (void) mutex_init(hp->tcp_lock, NULL, NULL);
+ (void) mutex_init(hp->tcp_lock, USYNC_THREAD, NULL);
}
if (!hp->tcp_wait) {
if (!(hp->tcp_wait = malloc(sizeof (*(hp->tcp_wait))))) {
@@ -144,7 +142,7 @@ void slp_uc_tcp_send(slp_handle_impl_t *hp, slp_target_t *target,
"out of memory");
return;
}
- (void) cond_init(hp->tcp_wait, NULL, NULL);
+ (void) cond_init(hp->tcp_wait, USYNC_THREAD, NULL);
}
(void) mutex_lock(hp->tcp_lock);
(hp->tcp_ref_cnt)++;
@@ -421,7 +419,7 @@ static SLPError start_tcp_thr() {
}
/* start the tcp thread */
- if ((terr = thr_create(0, NULL, (void *(*)(void *)) tcp_thread,
+ if ((terr = thr_create(0, 0, (void *(*)(void *)) tcp_thread,
NULL, 0, NULL)) != 0) {
slp_err(LOG_CRIT, 0, "start_tcp_thr",
"could not start thread: %s", strerror(terr));
diff --git a/usr/src/lib/libslp/clib/slp_queue.c b/usr/src/lib/libslp/clib/slp_queue.c
index 46dc0f7f31..41d880323e 100644
--- a/usr/src/lib/libslp/clib/slp_queue.c
+++ b/usr/src/lib/libslp/clib/slp_queue.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* A synchronized FIFO queue for inter-thread producer-consumer semantics.
* This queue will handle multiple writers and readers simultaneously.
@@ -93,7 +91,7 @@ slp_queue_t *slp_new_queue(SLPError *err) {
slp_err(LOG_CRIT, 0, "slp_new_queue", "out of memory");
return (NULL);
}
- (void) cond_init(wait, NULL, NULL);
+ (void) cond_init(wait, USYNC_THREAD, NULL);
/* create the queue */
if ((q = malloc(sizeof (*q))) == NULL) {