summaryrefslogtreecommitdiff
path: root/usr/src/lib
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2017-12-14 13:13:47 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2017-12-14 13:13:47 +0000
commitcfd45dc56a5903c63d99aba69aff2b978dcac4b6 (patch)
treee279dc697e4e4451784469aeb4e45a64ae2e7b96 /usr/src/lib
parenta52dd1de494223aa5cbd41a0f9caa61a31da59cf (diff)
parent739415d128746863863f9005c1923d9f5dd397e4 (diff)
downloadillumos-joyent-cfd45dc56a5903c63d99aba69aff2b978dcac4b6.tar.gz
[illumos-gate merge]
commit 739415d128746863863f9005c1923d9f5dd397e4 8916 man pages should refer to our own Dynamic Tracing Guide 8915 remove reference to kgmon in lockstat(1m) commit 435a78cc932ae710cfa076091a136712cf13ccf2 8885 64-bit libbsm:adt_do_ipv[46]_address creates non-compressible at_port. commit f6969e9b236c140638ae16b1d5c8dff401e31465 8848 hbaapi: variable set but not used commit 4c307623be8d9c2d69ed7e8622a1ab0a6348d0dd 8843 libnls: variable 'version' set but not used commit 19700af4088d99a0f173873dcdfcf51fdb90335b 8830 libshell: variable set but not used commit 1d6eba5f15dcb03614b687ec6ddaa6477b7baa41 8823 print: variable 'error' set but not used commit a1a46df055863a267eb7a80b7961c9379bc457ec 8822 libsmbfs: variable set but not used commit 8f33f62fe3b6ef9b5f9a849a5d2081f34e048be2 8819 x86 unix: variable set but not used commit ea6a05275c5cbe13e3a79eb7efb3a0a097613149 8813 rdsv3: variable 'timeo' set but not used commit 8b9a0f1ef5cee53073074965f0ea1d015d66926f 8812 xge: variable set but not used commit a3907569cb648b92b09b4854131a106aafecab36 8911 loader: move ficl outb and inb into libi386
Diffstat (limited to 'usr/src/lib')
-rw-r--r--usr/src/lib/hbaapi/common/HBAAPILIB.c11
-rw-r--r--usr/src/lib/libbsm/common/adt.c39
-rw-r--r--usr/src/lib/libnls/common/nlsrequest.c58
-rw-r--r--usr/src/lib/libshell/common/bltins/misc.c3
-rw-r--r--usr/src/lib/libshell/common/sh/parse.c7
-rw-r--r--usr/src/lib/libshell/common/sh/xec.c2
-rw-r--r--usr/src/lib/print/libpapi-dynamic/common/psm.c13
7 files changed, 87 insertions, 46 deletions
diff --git a/usr/src/lib/hbaapi/common/HBAAPILIB.c b/usr/src/lib/hbaapi/common/HBAAPILIB.c
index 9a9c114100..d0e3e31b0e 100644
--- a/usr/src/lib/hbaapi/common/HBAAPILIB.c
+++ b/usr/src/lib/hbaapi/common/HBAAPILIB.c
@@ -515,7 +515,9 @@ HBA_LoadLibrary(void) {
int ret;
#endif
HBA_STATUS status;
+#ifdef NOTDEF
HBA_UINT32 libversion;
+#endif
/* Open configuration file from known location */
#ifdef WIN32
@@ -633,10 +635,10 @@ HBA_LoadLibrary(void) {
/* ???Opportunity to send error msg, library error? */
goto dud_library;
}
+#ifdef NOTDEF /* save for a later time... when it matters */
/* Check the version of this library before loading */
/* Actually... This wrapper is compatible with version 1 */
libversion = ((GetVersionFunc)());
-#ifdef NOTDEF /* save for a later time... when it matters */
if (libversion < HBA_LIBVERSION) {
goto dud_library;
}
@@ -792,17 +794,17 @@ HBA_LoadLibrary(void) {
== NULL) {
continue;
}
+#ifdef NOTDEF /* save for a later time... when it matters */
libversion = ((GetVersionFunc)());
/* Check the version of this library before loading */
/* Actually... This wrapper is compatible with version 1 */
-#ifdef NOTDEF /* save for a later time... when it matters */
if(libversion < HBA_LIBVERSION) {
printf("Library version mismatch. Got %d expected %d.\n",
libversion, HBA_LIBVERSION);
continue;
}
-#endif
DEBUG(1, "%s libversion = %d", librarypath, libversion, 0);
+#endif
LoadLibraryFunc = lib_infop->functionTable.LoadLibraryHandler;
if (LoadLibraryFunc == NULL) {
/* this function is required */
@@ -874,7 +876,6 @@ HBA_LoadLibrary(void) {
HBA_STATUS
HBA_FreeLibrary(void) {
HBAFreeLibraryFunc FreeLibraryFunc;
- HBA_STATUS status;
HBA_LIBRARY_INFO *lib_infop;
HBA_LIBRARY_INFO *lib_next;
HBA_ADAPTERCALLBACK_ELEM
@@ -893,7 +894,7 @@ HBA_FreeLibrary(void) {
FreeLibraryFunc = lib_infop->functionTable.FreeLibraryHandler;
if (FreeLibraryFunc != NULL) {
/* Free this library */
- status = ((FreeLibraryFunc)());
+ (void)((FreeLibraryFunc)());
}
#ifdef WIN32
FreeLibrary(lib_infop->hLibrary); /* Unload DLL from memory */
diff --git a/usr/src/lib/libbsm/common/adt.c b/usr/src/lib/libbsm/common/adt.c
index 4cf0dd7566..20741efa75 100644
--- a/usr/src/lib/libbsm/common/adt.c
+++ b/usr/src/lib/libbsm/common/adt.c
@@ -22,6 +22,7 @@
/*
* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2013, Joyent, Inc. All rights reserved.
+ * Copyright 2017 OmniOS Community Edition (OmniOSce) Association.
*/
#include <bsm/adt.h>
@@ -589,12 +590,42 @@ adt_set_mask(const adt_session_data_t *session_data, const au_mask_t *mask)
* helpers for adt_load_termid
*/
+static dev_t
+adt_ports_to_at_port(in_port_t remote, in_port_t local)
+{
+ dev_t port;
+
+#ifdef _LP64
+ dev_t tmp;
+
+ /*
+ * In 64-bit, at_port is a 64-bit value encoding major/minor
+ * device numbers as 32-bits each. However when a 32-bit application
+ * subsequently requests the audit address via getaudit_addr(), this
+ * value must be capable of being compressed down to a 14-bit major and
+ * 18-bit minor number or the call will fail.
+ *
+ * In order to construct a 32-bit compatible value, the top 14-bits of
+ * the remote port are used for the major number and the remaining
+ * 2-bits + local port are used for the minor.
+ */
+
+ tmp = ((remote<<16) | (local));
+ port = (tmp & MAXMIN32);
+ port |= (((tmp >> NBITSMINOR32) & MAXMAJ32) << NBITSMINOR64);
+#else
+ port = ((remote<<16) | (local));
+#endif
+
+ return (port);
+}
+
static void
adt_do_ipv6_address(struct sockaddr_in6 *peer, struct sockaddr_in6 *sock,
au_tid_addr_t *termid)
{
-
- termid->at_port = ((peer->sin6_port<<16) | (sock->sin6_port));
+ termid->at_port =
+ adt_ports_to_at_port(peer->sin6_port, sock->sin6_port);
termid->at_type = AU_IPv6;
(void) memcpy(termid->at_addr, &peer->sin6_addr, 4 * sizeof (uint_t));
}
@@ -603,9 +634,7 @@ static void
adt_do_ipv4_address(struct sockaddr_in *peer, struct sockaddr_in *sock,
au_tid_addr_t *termid)
{
-
- termid->at_port = ((peer->sin_port<<16) | (sock->sin_port));
-
+ termid->at_port = adt_ports_to_at_port(peer->sin_port, sock->sin_port);
termid->at_type = AU_IPv4;
termid->at_addr[0] = (uint32_t)peer->sin_addr.s_addr;
(void) memset(&(termid->at_addr[1]), 0, 3 * sizeof (uint_t));
diff --git a/usr/src/lib/libnls/common/nlsrequest.c b/usr/src/lib/libnls/common/nlsrequest.c
index 547aeff2f2..b7965646d5 100644
--- a/usr/src/lib/libnls/common/nlsrequest.c
+++ b/usr/src/lib/libnls/common/nlsrequest.c
@@ -22,9 +22,6 @@
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
-
-#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.5.1.1 */
-
/*
*
* nlsrequest(3):
@@ -67,7 +64,7 @@ nlsrequest(int fd, char *svc_code)
int len, err, flags;
char buf[256];
char *p;
- int version, ret;
+ int ret;
extern int t_errno;
t_errno = 0; /* indicates a 'name' problem */
@@ -79,55 +76,68 @@ nlsrequest(int fd, char *svc_code)
if (!svc_code || !strlen(svc_code) ||
(strlen(svc_code) >= (size_t)SVC_CODE_SZ)) {
- if (_nlslog)
- fprintf(stderr, "nlsrequest: invalid service code format\n");
- return(-1);
+ if (_nlslog) {
+ fprintf(stderr,
+ "nlsrequest: invalid service code format\n");
+ }
+ return (-1);
}
/*
* send protocol message requesting the service
*/
- len = sprintf(buf, nls_v2_msg, svc_code)+1;/* inc trailing null */
+ len = sprintf(buf, nls_v2_msg, svc_code) + 1; /* inc trailing null */
if (t_snd(fd, buf, len, 0) < len) {
if (_nlslog)
t_error("t_snd of listener request message failed");
- return(-1);
+ return (-1);
}
p = _nlsbuf;
len = 0;
do {
- if (++len > sizeof(_nlsbuf)) {
- if (_nlslog)
- fprintf(stderr, "nlsrequest: _nlsbuf not large enough\n");
- return(-1);
+ if (++len > sizeof (_nlsbuf)) {
+ if (_nlslog) {
+ fprintf(stderr,
+ "nlsrequest: _nlsbuf not large enough\n");
+ }
+ return (-1);
}
- if (t_rcv(fd, p, sizeof(char), &flags) != sizeof(char)) {
- if (_nlslog)
- t_error("t_rcv of listener response msg failed");
- return(-1);
+ if (t_rcv(fd, p, sizeof (char), &flags) != sizeof (char)) {
+ if (_nlslog) {
+ t_error("t_rcv of listener response msg "
+ "failed");
+ }
+ return (-1);
}
} while (*p++ != '\0');
- if ((p = strtok(_nlsbuf, ":")) == (char *)0)
+ if ((p = strtok(_nlsbuf, ":")) == NULL)
goto parsefail;
- version = atoi(p);
- if ((p = strtok((char *)0, ":")) == (char *)0)
+ /*
+ * We ignore the version number here as we do not have any use for it.
+ * Previous versions of the code looked at it by calling atoi() on it,
+ * which did not mutate the actual string and did not use it.
+ */
+
+ if ((p = strtok(NULL, ":")) == NULL)
goto parsefail;
ret = atoi(p);
_nlsrmsg = p + strlen(p) + 1;
if (ret && _nlslog)
fprintf(stderr, "%s\n", _nlsrmsg); /* debug only */
- return(ret);
+ return (ret);
parsefail:
- if (_nlslog)
- fprintf(stderr, "nlsrequest: failed parse of response message\n");
- return(-1);
+ if (_nlslog) {
+ fprintf(stderr,
+ "nlsrequest: failed parse of response message\n");
+ }
+ return (-1);
}
diff --git a/usr/src/lib/libshell/common/bltins/misc.c b/usr/src/lib/libshell/common/bltins/misc.c
index 237a4448ee..04066e1a29 100644
--- a/usr/src/lib/libshell/common/bltins/misc.c
+++ b/usr/src/lib/libshell/common/bltins/misc.c
@@ -57,7 +57,8 @@ struct login
char *arg0;
};
-int b_exec(int argc,char *argv[], void *extra)
+int
+b_exec(int argc __unused, char *argv[], void *extra)
{
struct login logdata;
register int n;
diff --git a/usr/src/lib/libshell/common/sh/parse.c b/usr/src/lib/libshell/common/sh/parse.c
index 28d52ac769..35aca3f496 100644
--- a/usr/src/lib/libshell/common/sh/parse.c
+++ b/usr/src/lib/libshell/common/sh/parse.c
@@ -1285,7 +1285,7 @@ static Shnode_t *simple(Lex_t *lexp,int flag, struct ionod *io)
struct argnod **argtail;
struct argnod **settail;
int cmdarg=0;
- int argno = 0, argmax=0;
+ int argno = 0;
int assignment = 0;
int key_on = (!(flag&SH_NOIO) && sh_isoption(SH_KEYWORD));
int associative=0;
@@ -1347,8 +1347,6 @@ static Shnode_t *simple(Lex_t *lexp,int flag, struct ionod *io)
{
if(!(argp->argflag&ARG_RAW))
{
- if(argno>0)
- argmax = argno;
argno = -1;
}
if(argno>=0 && argno++==cmdarg && !(flag&SH_ARRAY) && *argp->argval!='/')
@@ -1388,7 +1386,6 @@ static Shnode_t *simple(Lex_t *lexp,int flag, struct ionod *io)
if((tok==IPROCSYM || tok==OPROCSYM))
{
argp = process_sub(lexp,tok);
- argmax = 0;
argno = -1;
*argtail = argp;
argtail = &(argp->argnxt.ap);
@@ -1445,8 +1442,6 @@ static Shnode_t *simple(Lex_t *lexp,int flag, struct ionod *io)
}
}
*argtail = 0;
- if(argno>0)
- argmax = argno;
t->comtyp = TCOM;
#if SHOPT_KIA
if(lexp->kiafile && !(flag&SH_NOIO))
diff --git a/usr/src/lib/libshell/common/sh/xec.c b/usr/src/lib/libshell/common/sh/xec.c
index e6ba69dd74..afceb6a355 100644
--- a/usr/src/lib/libshell/common/sh/xec.c
+++ b/usr/src/lib/libshell/common/sh/xec.c
@@ -2977,7 +2977,7 @@ static pid_t sh_ntfork(Shell_t *shp,const Shnode_t *t,char *argv[],int *jobid,in
{
static pid_t spawnpid;
static int savetype;
- static int savejobid;
+ static int savejobid __unused;
struct checkpt buff;
int otype=0, jmpval;
volatile int jobwasset=0, scope=0, sigwasset=0;
diff --git a/usr/src/lib/print/libpapi-dynamic/common/psm.c b/usr/src/lib/print/libpapi-dynamic/common/psm.c
index af31f24b4e..a928de0991 100644
--- a/usr/src/lib/print/libpapi-dynamic/common/psm.c
+++ b/usr/src/lib/print/libpapi-dynamic/common/psm.c
@@ -27,8 +27,6 @@
/* $Id: psm.c 146 2006-03-24 00:26:54Z njacobs $ */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
@@ -63,7 +61,7 @@ psm_open(service_t *svc, char *scheme)
result = PAPI_NOT_POSSIBLE;
#ifdef DEBUG
detailed_error(svc, "psm_open(%s): %s: %s", scheme, path,
- dlerror());
+ dlerror());
#endif
}
@@ -79,12 +77,19 @@ psm_close(void *handle)
void *
psm_sym(service_t *svc, char *name)
{
+#ifdef DEBUG
char *error = "invalid input";
+#endif
void *func = NULL;
if ((svc != NULL) && (svc->so_handle != NULL) && (name != NULL)) {
- if ((func = dlsym(svc->so_handle, name)) == NULL)
+ if ((func = dlsym(svc->so_handle, name)) == NULL) {
+#ifdef DEBUG
error = dlerror();
+#else
+ return (func);
+#endif
+ }
}
#ifdef DEBUG
if (func == NULL)