summaryrefslogtreecommitdiff
path: root/usr/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib')
-rw-r--r--usr/src/lib/brand/lx/librtld_db/common/lx_librtld_db.c11
-rw-r--r--usr/src/lib/brand/lx/lx_brand/common/clone.c4
-rw-r--r--usr/src/lib/brand/lx/lx_brand/common/lx_brand.c52
-rw-r--r--usr/src/lib/brand/lx/lx_brand/common/signal.c12
-rw-r--r--usr/src/lib/brand/lx/lx_brand/common/time.c8
-rw-r--r--usr/src/lib/brand/lx/lx_vdso/tools/vdso_tool.c5
-rw-r--r--usr/src/lib/fm/topo/modules/common/ipmi/ipmi_enum.c2
-rw-r--r--usr/src/lib/libzonecfg/common/libzonecfg.c2
-rw-r--r--usr/src/lib/varpd/libvarpd/common/libvarpd_client.c4
-rw-r--r--usr/src/lib/varpd/svp/common/libvarpd_svp_remote.c4
10 files changed, 52 insertions, 52 deletions
diff --git a/usr/src/lib/brand/lx/librtld_db/common/lx_librtld_db.c b/usr/src/lib/brand/lx/librtld_db/common/lx_librtld_db.c
index ddea4f910d..9f729ab1a6 100644
--- a/usr/src/lib/brand/lx/librtld_db/common/lx_librtld_db.c
+++ b/usr/src/lib/brand/lx/librtld_db/common/lx_librtld_db.c
@@ -24,7 +24,7 @@
*/
/*
- * Copyright 2015 Joyent, Inc. All rights reserved.
+ * Copyright 2019 Joyent, Inc.
*/
#include <stdio.h>
@@ -687,7 +687,7 @@ lx_elf_props32(struct ps_prochandle *php, uint32_t addr, psaddr_t *data_addr)
int i;
uint32_t min = (uint32_t)-1;
uint32_t max = 0;
- size_t sz = NULL;
+ size_t sz = 0;
if (ps_pread(php, addr, &ehdr, sizeof (ehdr)) != PS_OK) {
ps_plog("lx_elf_props: Couldn't read ELF header at 0x%p",
@@ -742,7 +742,7 @@ lx_ldb_loadobj_iter32(rd_helper_data_t rhd, rl_iter_f *cb, void *client_data)
struct ps_prochandle *php = lx_rd->lr_php;
lx_r_debug_t r_debug;
lx_link_map_t map;
- uint32_t p = NULL;
+ uint32_t p = (uint32_t)(uintptr_t)NULL;
int rc;
rd_loadobj_t exec;
@@ -786,7 +786,8 @@ lx_ldb_loadobj_iter32(rd_helper_data_t rhd, rl_iter_f *cb, void *client_data)
ps_plog("lx_ldb_loadobj_iter: exec base 0x%p dyn 0x%p",
exec.rl_base, exec.rl_dynamic);
- for (p = map.lxm_next; p != NULL; p = map.lxm_next) {
+ for (p = map.lxm_next; p != (uint32_t)(uintptr_t)NULL;
+ p = map.lxm_next) {
rd_loadobj_t obj;
if ((rc = ps_pread(php, (psaddr_t)p, &map, sizeof (map))) !=
@@ -805,7 +806,7 @@ lx_ldb_loadobj_iter32(rd_helper_data_t rhd, rl_iter_f *cb, void *client_data)
obj.rl_nameaddr = (psaddr_t)map.lxm_name;
obj.rl_base = map.lxm_addr;
obj.rl_refnameaddr = (psaddr_t)map.lxm_name;
- obj.rl_plt_base = NULL;
+ obj.rl_plt_base = (psaddr_t)NULL;
obj.rl_plt_size = 0;
obj.rl_lmident = LM_ID_BASE;
diff --git a/usr/src/lib/brand/lx/lx_brand/common/clone.c b/usr/src/lib/brand/lx/lx_brand/common/clone.c
index b540d5a55e..c6048281b5 100644
--- a/usr/src/lib/brand/lx/lx_brand/common/clone.c
+++ b/usr/src/lib/brand/lx/lx_brand/common/clone.c
@@ -22,7 +22,7 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- * Copyright 2018 Joyent, Inc.
+ * Copyright 2019 Joyent, Inc.
*/
#include <assert.h>
@@ -687,7 +687,7 @@ lx_clone(uintptr_t p1, uintptr_t p2, uintptr_t p3, uintptr_t p4, uintptr_t p5)
return (-ENOMEM);
}
- rval = thr_create(NULL, NULL, clone_start, cs, THR_DETACHED, &tid);
+ rval = thr_create(NULL, 0, clone_start, cs, THR_DETACHED, &tid);
/*
* If the thread did not start, free the resources we allocated:
diff --git a/usr/src/lib/brand/lx/lx_brand/common/lx_brand.c b/usr/src/lib/brand/lx/lx_brand/common/lx_brand.c
index 653973a2db..7373a0d02f 100644
--- a/usr/src/lib/brand/lx/lx_brand/common/lx_brand.c
+++ b/usr/src/lib/brand/lx/lx_brand/common/lx_brand.c
@@ -25,7 +25,7 @@
*/
/*
- * Copyright 2018 Joyent, Inc.
+ * Copyright 2019 Joyent, Inc.
*/
#include <sys/types.h>
@@ -519,7 +519,7 @@ lx_start(uintptr_t sp, uintptr_t entry)
jump_uc.uc_flags = UC_CPU;
jump_uc.uc_brand_data[0] = (void *)LX_UC_STACK_BRAND;
- LX_REG(&jump_uc, REG_FP) = NULL;
+ LX_REG(&jump_uc, REG_FP) = (uintptr_t)NULL;
LX_REG(&jump_uc, REG_SP) = sp;
LX_REG(&jump_uc, REG_PC) = entry;
@@ -531,29 +531,29 @@ lx_start(uintptr_t sp, uintptr_t entry)
* zeroed prior to initial execution.
*/
#if defined(_LP64)
- LX_REG(&jump_uc, REG_RAX) = NULL;
- LX_REG(&jump_uc, REG_RCX) = NULL;
- LX_REG(&jump_uc, REG_RDX) = NULL;
- LX_REG(&jump_uc, REG_RBX) = NULL;
- LX_REG(&jump_uc, REG_RBP) = NULL;
- LX_REG(&jump_uc, REG_RSI) = NULL;
- LX_REG(&jump_uc, REG_RDI) = NULL;
- LX_REG(&jump_uc, REG_R8) = NULL;
- LX_REG(&jump_uc, REG_R9) = NULL;
- LX_REG(&jump_uc, REG_R10) = NULL;
- LX_REG(&jump_uc, REG_R11) = NULL;
- LX_REG(&jump_uc, REG_R12) = NULL;
- LX_REG(&jump_uc, REG_R13) = NULL;
- LX_REG(&jump_uc, REG_R14) = NULL;
- LX_REG(&jump_uc, REG_R15) = NULL;
+ LX_REG(&jump_uc, REG_RAX) = 0;
+ LX_REG(&jump_uc, REG_RCX) = 0;
+ LX_REG(&jump_uc, REG_RDX) = 0;
+ LX_REG(&jump_uc, REG_RBX) = 0;
+ LX_REG(&jump_uc, REG_RBP) = 0;
+ LX_REG(&jump_uc, REG_RSI) = 0;
+ LX_REG(&jump_uc, REG_RDI) = 0;
+ LX_REG(&jump_uc, REG_R8) = 0;
+ LX_REG(&jump_uc, REG_R9) = 0;
+ LX_REG(&jump_uc, REG_R10) = 0;
+ LX_REG(&jump_uc, REG_R11) = 0;
+ LX_REG(&jump_uc, REG_R12) = 0;
+ LX_REG(&jump_uc, REG_R13) = 0;
+ LX_REG(&jump_uc, REG_R14) = 0;
+ LX_REG(&jump_uc, REG_R15) = 0;
#else
- LX_REG(&jump_uc, EAX) = NULL;
- LX_REG(&jump_uc, ECX) = NULL;
- LX_REG(&jump_uc, EDX) = NULL;
- LX_REG(&jump_uc, EBX) = NULL;
- LX_REG(&jump_uc, EBP) = NULL;
- LX_REG(&jump_uc, ESI) = NULL;
- LX_REG(&jump_uc, EDI) = NULL;
+ LX_REG(&jump_uc, EAX) = 0;
+ LX_REG(&jump_uc, ECX) = 0;
+ LX_REG(&jump_uc, EDX) = 0;
+ LX_REG(&jump_uc, EBX) = 0;
+ LX_REG(&jump_uc, EBP) = 0;
+ LX_REG(&jump_uc, ESI) = 0;
+ LX_REG(&jump_uc, EDI) = 0;
#endif /* defined(_LP64) */
lx_debug("starting Linux program sp %p ldentry %p", sp, entry);
@@ -736,7 +736,7 @@ lx_init(int argc, char *argv[], char *envp[])
* Find the aux vector on the stack.
*/
p = (long *)envp;
- while (*p != NULL)
+ while (*p != (uintptr_t)NULL)
p++;
/*
@@ -755,7 +755,7 @@ lx_init(int argc, char *argv[], char *envp[])
*/
p++;
oap = (auxv_t *)p;
- while (*p == NULL)
+ while (*p == (uintptr_t)NULL)
p++;
ap = (auxv_t *)p;
diff --git a/usr/src/lib/brand/lx/lx_brand/common/signal.c b/usr/src/lib/brand/lx/lx_brand/common/signal.c
index b9356d16ab..74abff9c8c 100644
--- a/usr/src/lib/brand/lx/lx_brand/common/signal.c
+++ b/usr/src/lib/brand/lx/lx_brand/common/signal.c
@@ -25,7 +25,7 @@
*/
/*
- * Copyright 2018 Joyent, Inc. All rights reserved.
+ * Copyright 2019 Joyent, Inc.
*/
#include <sys/types.h>
@@ -617,7 +617,7 @@ lx_sigaltstack(uintptr_t ssp, uintptr_t oss)
lx_tsd_t *lxtsd = lx_get_tsd();
lx_stack_t ss;
- if (ssp != NULL) {
+ if (ssp != (uintptr_t)NULL) {
if (lxtsd->lxtsd_sigaltstack.ss_flags & LX_SS_ONSTACK) {
/*
* If we are currently using the installed alternate
@@ -650,7 +650,7 @@ lx_sigaltstack(uintptr_t ssp, uintptr_t oss)
}
}
- if (oss != NULL) {
+ if (oss != (uintptr_t)NULL) {
/*
* User provided old and new stack_t pointers may point to
* the same location. Copy out before we modify.
@@ -661,7 +661,7 @@ lx_sigaltstack(uintptr_t ssp, uintptr_t oss)
}
}
- if (ssp != NULL) {
+ if (ssp != (uintptr_t)NULL) {
lxtsd->lxtsd_sigaltstack = ss;
}
@@ -891,7 +891,7 @@ lx_rt_sigtimedwait(uintptr_t set, uintptr_t sinfo, uintptr_t toutp,
*/
if ((rc = sigtimedwait(&s_set, s_sinfop,
(struct timespec *)toutp)) == -1)
- return (toutp == NULL ? -EINTR : -errno);
+ return (toutp == (uintptr_t)NULL ? -EINTR : -errno);
if (s_sinfop == NULL)
return (stol_signo[rc]);
@@ -1331,7 +1331,7 @@ lx_build_signal_frame(int lx_sig, siginfo_t *sip, void *p, void *sp,
* hdlr(int sig, siginfo_t *sip, void *ucp);
*/
hargs[0] = lx_sig;
- hargs[1] = sip != NULL ? (uintptr_t)&lx_ssp->si : NULL;
+ hargs[1] = sip != NULL ? (uintptr_t)&lx_ssp->si : (uintptr_t)NULL;
hargs[2] = (uintptr_t)lx_ucp;
#endif
diff --git a/usr/src/lib/brand/lx/lx_brand/common/time.c b/usr/src/lib/brand/lx/lx_brand/common/time.c
index db63c5643c..9b82ec98b5 100644
--- a/usr/src/lib/brand/lx/lx_brand/common/time.c
+++ b/usr/src/lib/brand/lx/lx_brand/common/time.c
@@ -22,7 +22,7 @@
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- * Copyright 2017 Joyent, Inc. All rights reserved.
+ * Copyright 2019 Joyent, Inc.
*/
#include <errno.h>
@@ -93,7 +93,7 @@ lx_settimeofday(uintptr_t p1, uintptr_t p2)
struct timeval tv;
struct lx_timezone tz;
- if ((p1 != NULL) &&
+ if ((p1 != (uintptr_t)NULL) &&
(uucopy((struct timeval *)p1, &tv, sizeof (tv)) < 0))
return (-errno);
@@ -102,11 +102,11 @@ lx_settimeofday(uintptr_t p1, uintptr_t p2)
* but settimeofday(2) should still return EFAULT if it is set
* to a bad non-NULL pointer (sigh...)
*/
- if ((p2 != NULL) &&
+ if ((p2 != (uintptr_t)NULL) &&
(uucopy((struct lx_timezone *)p2, &tz, sizeof (tz)) < 0))
return (-errno);
- if ((p1 != NULL) && (settimeofday(&tv, NULL) < 0))
+ if ((p1 != (uintptr_t)NULL) && (settimeofday(&tv, NULL) < 0))
return (-errno);
return (0);
diff --git a/usr/src/lib/brand/lx/lx_vdso/tools/vdso_tool.c b/usr/src/lib/brand/lx/lx_vdso/tools/vdso_tool.c
index 0e1d99f9da..c423184138 100644
--- a/usr/src/lib/brand/lx/lx_vdso/tools/vdso_tool.c
+++ b/usr/src/lib/brand/lx/lx_vdso/tools/vdso_tool.c
@@ -10,7 +10,7 @@
*/
/*
- * Copyright 2015 Joyent, Inc.
+ * Copyright 2019 Joyent, Inc.
*/
/*
@@ -293,8 +293,7 @@ update_pt_load_size(vdso_t *v)
phdr.p_memsz = phdr.p_filesz = v->v_max_offset;
- if (gelf_update_phdr(v->v_elf, v->v_ptload_phdr, &phdr) ==
- NULL) {
+ if (gelf_update_phdr(v->v_elf, v->v_ptload_phdr, &phdr) == 0) {
(void) fprintf(stderr, "could not update PT_LOAD "
"phdr: %s", elf_errmsg(-1));
goto errout;
diff --git a/usr/src/lib/fm/topo/modules/common/ipmi/ipmi_enum.c b/usr/src/lib/fm/topo/modules/common/ipmi/ipmi_enum.c
index c5ef0fbb4c..a2b5274354 100644
--- a/usr/src/lib/fm/topo/modules/common/ipmi/ipmi_enum.c
+++ b/usr/src/lib/fm/topo/modules/common/ipmi/ipmi_enum.c
@@ -568,7 +568,7 @@ ipmi_enum_sp(topo_mod_t *mod, tnode_t *pnode)
}
if (topo_node_fru(pnode, &fmri, NULL, &err) != 0 ||
- topo_node_fru_set(sp_node, fmri, NULL, &err) != 0) {
+ topo_node_fru_set(sp_node, fmri, 0, &err) != 0) {
topo_mod_dprintf(mod, "failed to set FRU on %s=%d: %s", SP, 0,
topo_strerror(err));
nvlist_free(fmri);
diff --git a/usr/src/lib/libzonecfg/common/libzonecfg.c b/usr/src/lib/libzonecfg/common/libzonecfg.c
index 27eb28206c..e709b7dba8 100644
--- a/usr/src/lib/libzonecfg/common/libzonecfg.c
+++ b/usr/src/lib/libzonecfg/common/libzonecfg.c
@@ -2163,7 +2163,7 @@ normalize_mac_addr(char *dst, const char *src, int len)
p = strtok(buf, ":");
while (p != NULL) {
n = strtol(p, &e, 16);
- if (*e != NULL || n > 0xff)
+ if (*e != '\0' || n > 0xff)
return;
(void) snprintf(tmp, sizeof (tmp), "%s%02x", sep, n);
(void) strlcat(dst, tmp, len);
diff --git a/usr/src/lib/varpd/libvarpd/common/libvarpd_client.c b/usr/src/lib/varpd/libvarpd/common/libvarpd_client.c
index 260bbb6e92..18e220259c 100644
--- a/usr/src/lib/varpd/libvarpd/common/libvarpd_client.c
+++ b/usr/src/lib/varpd/libvarpd/common/libvarpd_client.c
@@ -10,7 +10,7 @@
*/
/*
- * Copyright 2018 Joyent, Inc.
+ * Copyright 2019 Joyent, Inc.
*/
/*
@@ -378,7 +378,7 @@ libvarpd_c_prop_set(varpd_client_prop_handle_t *phdl, const void *buf,
varpd_client_prop_arg_t *vcpap = &carg.vca_un.vca_prop;
varpd_client_prop_info_t *infop = (varpd_client_prop_info_t *)phdl;
- if (len == NULL || buf == NULL || infop->vcprop_propid == UINT_MAX)
+ if (len == 0 || buf == NULL || infop->vcprop_propid == UINT_MAX)
return (EINVAL);
if (len > LIBVARPD_PROP_SIZEMAX)
return (EOVERFLOW);
diff --git a/usr/src/lib/varpd/svp/common/libvarpd_svp_remote.c b/usr/src/lib/varpd/svp/common/libvarpd_svp_remote.c
index 8d482e4a12..99775f93c0 100644
--- a/usr/src/lib/varpd/svp/common/libvarpd_svp_remote.c
+++ b/usr/src/lib/varpd/svp/common/libvarpd_svp_remote.c
@@ -10,7 +10,7 @@
*/
/*
- * Copyright 2015 Joyent, Inc.
+ * Copyright 2019 Joyent, Inc.
*/
/*
@@ -347,7 +347,7 @@ svp_remote_vl2_lookup(svp_t *svp, svp_query_t *sqp, const uint8_t *mac,
mutex_enter(&srp->sr_lock);
if (svp_remote_conn_queue(srp, sqp) == B_FALSE)
- svp->svp_cb.scb_vl2_lookup(svp, SVP_S_FATAL, NULL, NULL, arg);
+ svp->svp_cb.scb_vl2_lookup(svp, SVP_S_FATAL, NULL, 0, arg);
mutex_exit(&srp->sr_lock);
}