summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith M Wesolowski <wesolows@foobazco.org>2014-01-15 19:36:22 +0000
committerKeith M Wesolowski <wesolows@foobazco.org>2014-01-15 19:36:22 +0000
commit7178bc7969808c1ce80e356dd02782803cfa1e65 (patch)
tree123a57b5d41fc81e8f666c501c46c753c81819f6
parentd149d5197010d9c72af8b1e4b770e06d1309be57 (diff)
parent34969e746608c8170ab540c876836f625f25d8eb (diff)
downloadillumos-joyent-7178bc7969808c1ce80e356dd02782803cfa1e65.tar.gz
[illumos-gate merge]
commit 34969e746608c8170ab540c876836f625f25d8eb 4428 logadm ignoring -p flag commit c64d0c7c2b822e28df7036ee627f438587d05037 4481 snoop(1m) does not decode time in GETTIME rpcbind operation commit 78fb3df6a49cd4598f9bba9960558158f7ec440a 4456 snoop(1m) should display remote RPC calls in summary mode commit 023efabbe28d70d797973d99bf36d5552c2a8cb8 4195 snoop(1m) should print NFS_ACL mask in hex commit 84615402a46a91be66843bd64e4fb72642b06e9d 4430 libuuid could cache /dev/random commit 2db6d663182655cb393dc2c15668bc9293364594 4304 fmdump shall emit JSON commit 652601fb657e961ff66dadcd87ddfc146c5db0ca 4295 libshare sa_get_proto_status sometimes returns unallocated strings Conflicts: usr/src/lib/libuuid/common/uuid.c usr/src/lib/libshare/smb/libshare_smb.c usr/src/lib/libshare/autofs/libshare_autofs.c usr/src/lib/libnvpair/nvpair_json.c usr/src/cmd/logadm/conf.c
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_nfs_acl.c9
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_pmap.c179
-rw-r--r--usr/src/cmd/logadm/conf.c11
-rw-r--r--usr/src/lib/libnvpair/Makefile.com3
-rw-r--r--usr/src/lib/libnvpair/nvpair_json.c25
-rw-r--r--usr/src/lib/libshare/autofs/libshare_autofs.c4
-rw-r--r--usr/src/lib/libshare/nfs/libshare_nfs.c4
-rw-r--r--usr/src/lib/libshare/smb/libshare_smb.c4
-rw-r--r--usr/src/lib/libshare/smbfs/libshare_smbfs.c4
-rw-r--r--usr/src/lib/libuuid/common/uuid.c14
10 files changed, 137 insertions, 120 deletions
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_nfs_acl.c b/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_nfs_acl.c
index 937d7a08eb..4883ed5e23 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_nfs_acl.c
+++ b/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_nfs_acl.c
@@ -22,6 +22,9 @@
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
+/*
+ * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
+ */
#include <sys/types.h>
#include <sys/errno.h>
@@ -211,7 +214,7 @@ interpret_nfs_acl2(int flags, int type, int xid, int vers, int proc,
case ACLPROC2_GETACL:
fh = sum_nfsfh();
mask = getxdr_u_long();
- (void) sprintf(line, "%s mask=%lu", fh, mask);
+ (void) sprintf(line, "%s mask=0x%lx", fh, mask);
break;
case ACLPROC2_SETACL:
(void) sprintf(line, sum_nfsfh());
@@ -305,7 +308,7 @@ interpret_nfs_acl3(int flags, int type, int xid, int vers, int proc,
case ACLPROC3_GETACL:
fh = sum_nfsfh3();
mask = getxdr_u_long();
- (void) sprintf(line, "%s mask=%lu", fh, mask);
+ (void) sprintf(line, "%s mask=0x%lx", fh, mask);
break;
case ACLPROC3_SETACL:
(void) sprintf(line, sum_nfsfh3());
@@ -380,7 +383,7 @@ interpret_nfs_acl4(int flags, int type, int xid, int vers, int proc,
case ACLPROC4_GETACL:
fh = sum_nfsfh3();
mask = getxdr_u_long();
- (void) sprintf(line, "%s mask=%lu", fh, mask);
+ (void) sprintf(line, "%s mask=0x%lx", fh, mask);
break;
case ACLPROC4_SETACL:
(void) sprintf(line, sum_nfsfh3());
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_pmap.c b/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_pmap.c
index fbb9778b5b..f31fb4cbc6 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_pmap.c
+++ b/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_pmap.c
@@ -23,8 +23,9 @@
* Copyright (c) 1991, 1999 by Sun Microsystems, Inc.
* All rights reserved.
*/
-
-#ident "%Z%%M% %I% %E% SMI" /* SunOS */
+/*
+ * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
+ */
#include <sys/types.h>
#include <sys/errno.h>
@@ -114,8 +115,7 @@ interpret_pmap_2(flags, type, xid, vers, proc, data, len)
iprog = getxdr_u_long();
ivers = getxdr_u_long();
iproc = getxdr_u_long();
- stash_callit(xid, pi_frame,
- iprog, ivers, iproc);
+ stash_callit(xid, pi_frame, iprog, ivers, iproc);
} else {
x = find_callit(xid);
}
@@ -129,9 +129,8 @@ interpret_pmap_2(flags, type, xid, vers, proc, data, len)
line = get_sum_line();
if (type == CALL) {
- (void) sprintf(line,
- "PORTMAP C %s",
- procnames_short_2[proc]);
+ (void) sprintf(line, "PORTMAP C %s",
+ procnames_short_2[proc]);
line += strlen(line);
switch (proc) {
case PMAPPROC_GETPORT:
@@ -139,22 +138,24 @@ interpret_pmap_2(flags, type, xid, vers, proc, data, len)
ivers = getxdr_u_long();
proto = getxdr_u_long();
(void) sprintf(line,
- " prog=%d (%s) vers=%d proto=%s",
- iprog, nameof_prog(iprog),
- ivers,
- getproto(proto));
+ " prog=%d (%s) vers=%d proto=%s",
+ iprog, nameof_prog(iprog),
+ ivers,
+ getproto(proto));
break;
case PMAPPROC_CALLIT:
- (void) getxdr_u_long(); /* length */
(void) sprintf(line,
- " prog=%s vers=%d proc=%d",
- nameof_prog(iprog),
- ivers, iproc);
- data += 16; /* prog+ver+proc+len */
- len -= 16;
- protoprint(flags, type, xid,
- iprog, ivers, iproc,
- data, len);
+ " prog=%s vers=%d proc=%d",
+ nameof_prog(iprog),
+ ivers, iproc);
+ if (flags & F_ALLSUM) {
+ (void) getxdr_u_long(); /* length */
+ data += 16; /* prog+ver+proc+len */
+ len -= 16;
+ protoprint(flags, type, xid,
+ iprog, ivers, iproc,
+ data, len);
+ }
break;
default:
break;
@@ -162,29 +163,29 @@ interpret_pmap_2(flags, type, xid, vers, proc, data, len)
check_retransmit(line, xid);
} else {
(void) sprintf(line, "PORTMAP R %s ",
- procnames_short_2[proc]);
+ procnames_short_2[proc]);
line += strlen(line);
switch (proc) {
case PMAPPROC_GETPORT:
port = getxdr_u_long();
- (void) sprintf(line, "port=%d",
- port);
+ (void) sprintf(line, "port=%d", port);
break;
case PMAPPROC_DUMP:
- (void) sprintf(line, "%s",
- sum_pmaplist());
+ (void) sprintf(line, "%s", sum_pmaplist());
break;
case PMAPPROC_CALLIT:
port = getxdr_u_long();
ilen = getxdr_u_long();
(void) sprintf(line, "port=%d len=%d",
- port, ilen);
- if (x != NULL) {
+ port, ilen);
+ if (flags & F_ALLSUM && x != NULL) {
+ data += 8; /* port+len */
+ len -= 8;
protoprint(flags, type, xid,
- x->xid_prog,
- x->xid_vers,
- x->xid_proc,
- data, len);
+ x->xid_prog,
+ x->xid_vers,
+ x->xid_proc,
+ data, len);
}
break;
default:
@@ -211,33 +212,32 @@ interpret_pmap_2(flags, type, xid, vers, proc, data, len)
case PMAPPROC_GETPORT:
iprog = getxdr_u_long();
(void) sprintf(get_line(0, 0),
- "Program = %d (%s)",
- iprog, nameof_prog(iprog));
+ "Program = %d (%s)",
+ iprog, nameof_prog(iprog));
(void) showxdr_u_long("Version = %d");
proto = getxdr_u_long();
(void) sprintf(get_line(0, 0),
- "Protocol = %d (%s)",
- proto, getproto(proto));
+ "Protocol = %d (%s)",
+ proto, getproto(proto));
break;
case PMAPPROC_DUMP:
break;
case PMAPPROC_CALLIT:
(void) sprintf(get_line(0, 0),
- "Program = %d (%s)",
- iprog, nameof_prog(iprog));
+ "Program = %d (%s)",
+ iprog, nameof_prog(iprog));
(void) sprintf(get_line(0, 0),
- "Version = %d", ivers);
+ "Version = %d", ivers);
(void) sprintf(get_line(0, 0),
- "Proc = %d", iproc);
- (void) showxdr_u_long(
- "Callit data = %d bytes");
+ "Proc = %d", iproc);
+ (void) showxdr_u_long("Callit data = %d bytes");
show_trailer();
trailer_done = 1;
data += 16; /* prog+ver+proc+len */
len -= 16;
protoprint(flags, type, xid,
- iprog, ivers, iproc,
- data, len);
+ iprog, ivers, iproc,
+ data, len);
break;
}
} else {
@@ -259,10 +259,10 @@ interpret_pmap_2(flags, type, xid, vers, proc, data, len)
trailer_done = 1;
if (x != NULL) {
protoprint(flags, type, xid,
- x->xid_prog,
- x->xid_vers,
- x->xid_proc,
- data, len);
+ x->xid_prog,
+ x->xid_vers,
+ x->xid_proc,
+ data, len);
}
break;
}
@@ -303,13 +303,12 @@ show_pmaplist()
if (setjmp(xdr_err)) {
(void) sprintf(get_line(0, 0),
- " %d+ maps. (Frame is incomplete)",
- maps);
+ " %d+ maps. (Frame is incomplete)",
+ maps);
return;
}
- (void) sprintf(get_line(0, 0),
- " Program Version Protocol Port");
+ (void) sprintf(get_line(0, 0), " Program Version Protocol Port");
while (getxdr_u_long()) {
prog = getxdr_u_long();
@@ -317,8 +316,8 @@ show_pmaplist()
proto = getxdr_u_long();
port = getxdr_u_long();
(void) sprintf(get_line(0, 0),
- "%8d%8d%9d%7d %s",
- prog, vers, proto, port, nameof_prog(prog));
+ "%8d%8d%9d%7d %s",
+ prog, vers, proto, port, nameof_prog(prog));
maps++;
}
@@ -377,6 +376,7 @@ static char *procnames_long_4[] = {
"Get statistics", /* 12 */
};
+#define MAXPROC_3 8
#define MAXPROC_4 12
#define RPCBPROC_NULL 0
@@ -394,10 +394,10 @@ interpret_pmap_4(flags, type, xid, vers, proc, data, len)
struct cache_struct *x, *find_callit();
int trailer_done = 0;
- if (proc < 0 || proc > MAXPROC_4)
+ if (proc < 0 || proc > MAXPROC_4 || (vers == 3 && proc > MAXPROC_3))
return;
- if (proc == RPCBPROC_BCAST) {
+ if (proc == RPCBPROC_BCAST || proc == RPCBPROC_INDIRECT) {
if (type == CALL) {
iprog = getxdr_u_long();
ivers = getxdr_u_long();
@@ -436,16 +436,18 @@ interpret_pmap_4(flags, type, xid, vers, proc, data, len)
break;
case RPCBPROC_BCAST:
case RPCBPROC_INDIRECT:
- (void) getxdr_u_long(); /* length */
(void) sprintf(line,
" prog=%s vers=%d proc=%d",
nameof_prog(iprog),
ivers, iproc);
- data += 16; /* prog+ver+proc+len */
- len -= 16;
- protoprint(flags, type, xid,
- iprog, ivers, iproc,
- data, len);
+ if (flags & F_ALLSUM) {
+ (void) getxdr_u_long(); /* length */
+ data += 16; /* prog+ver+proc+len */
+ len -= 16;
+ protoprint(flags, type, xid,
+ iprog, ivers, iproc,
+ data, len);
+ }
break;
default:
break;
@@ -453,6 +455,8 @@ interpret_pmap_4(flags, type, xid, vers, proc, data, len)
check_retransmit(line, xid);
} else {
+ int pos;
+
(void) sprintf(line, "RPCBIND R %s ",
procnames_short_4[proc]);
line += strlen(line);
@@ -467,13 +471,15 @@ interpret_pmap_4(flags, type, xid, vers, proc, data, len)
break;
case RPCBPROC_BCAST:
case RPCBPROC_INDIRECT:
+ pos = getxdr_pos();
(void) getxdr_string(buff1, MAXSTRINGLEN);
ilen = getxdr_u_long();
(void) sprintf(line, "Uaddr=%s len=%d",
buff1, ilen);
- data += 16; /* prog+ver+proc+len */
- len -= 16;
- if (x != NULL) {
+ if (flags & F_ALLSUM && x != NULL) {
+ pos = getxdr_pos() - pos;
+ data += pos; /* uaddr+len */
+ len -= pos;
protoprint(flags, type, xid,
x->xid_prog,
x->xid_vers,
@@ -486,8 +492,12 @@ interpret_pmap_4(flags, type, xid, vers, proc, data, len)
sum_rpcblist());
break;
case RPCBPROC_GETTIME:
- (void) sprintf(line, "%s",
- getxdr_date());
+ {
+ time_t sec = getxdr_long();
+ struct tm *tmp = gmtime(&sec);
+ (void) strftime(line, MAXLINE,
+ "%d-%h-%y %T GMT", tmp);
+ }
break;
case RPCBPROC_GETADDRLIST:
(void) sprintf(line, "%s",
@@ -577,7 +587,14 @@ interpret_pmap_4(flags, type, xid, vers, proc, data, len)
}
break;
case RPCBPROC_GETTIME:
- (void) showxdr_date("Time = %s");
+ {
+ int pos = getxdr_pos();
+ time_t sec = getxdr_long();
+ struct tm *tmp = gmtime(&sec);
+ (void) strftime(get_line(pos,
+ getxdr_pos()), MAXLINE,
+ "Time = %d-%h-%y %T GMT", tmp);
+ }
break;
case RPCBPROC_UADDR2TADDR:
break;
@@ -625,14 +642,14 @@ show_rpcblist()
if (setjmp(xdr_err)) {
(void) sprintf(get_line(0, 0),
- " %d+ maps. (Frame is incomplete)",
- maps);
+ " %d+ maps. (Frame is incomplete)",
+ maps);
return;
}
show_space();
(void) sprintf(get_line(0, 0),
- " Program Vers Netid Uaddr Owner");
+ " Program Vers Netid Uaddr Owner");
while (getxdr_u_long()) {
prog = getxdr_u_long();
@@ -641,10 +658,10 @@ show_rpcblist()
(void) getxdr_string(uaddr, MAXSTRINGLEN);
(void) getxdr_string(owner, MAXSTRINGLEN);
(void) sprintf(get_line(0, 0),
- "%8d%5d %-12s %-18s %-10s (%s)",
- prog, vers,
- netid, uaddr, owner,
- nameof_prog(prog));
+ "%8d%5d %-12s %-18s %-10s (%s)",
+ prog, vers,
+ netid, uaddr, owner,
+ nameof_prog(prog));
maps++;
}
@@ -687,14 +704,14 @@ show_rpcb_entry_list()
if (setjmp(xdr_err)) {
(void) sprintf(get_line(0, 0),
- " %d+ maps. (Frame is incomplete)",
- maps);
+ " %d+ maps. (Frame is incomplete)",
+ maps);
return;
}
show_space();
(void) sprintf(get_line(0, 0),
- " Maddr Netid Semantics Protofmly Proto");
+ " Maddr Netid Semantics Protofmly Proto");
while (getxdr_u_long()) {
(void) getxdr_string(maddr, MAXSTRINGLEN);
@@ -703,10 +720,10 @@ show_rpcb_entry_list()
(void) getxdr_string(protofmly, MAXSTRINGLEN);
(void) getxdr_string(proto, MAXSTRINGLEN);
(void) sprintf(get_line(0, 0),
- "%-12s %-12s %-8s %-8s %-8s",
- maddr, netid,
- semantics_strs[sem],
- protofmly, proto);
+ "%-12s %-12s %-8s %-8s %-8s",
+ maddr, netid,
+ semantics_strs[sem],
+ protofmly, proto);
maps++;
}
diff --git a/usr/src/cmd/logadm/conf.c b/usr/src/cmd/logadm/conf.c
index b0d38aa483..0d22957a5e 100644
--- a/usr/src/cmd/logadm/conf.c
+++ b/usr/src/cmd/logadm/conf.c
@@ -282,12 +282,13 @@ conf_scan(const char *fname, char *buf, int buflen, int timescan)
opts = opts_parse(opts, Args, OPTF_CONF);
if (!timescan || cp == NULL) {
/*
- * If we're doing timescan and have what looks
- * like an orphaned entry (cp == NULL) then we
- * also have to track in this case. See the
+ * If we're not doing timescan, we track this
+ * entry. If we are doing timescan and have
+ * what looks like an orphaned entry (cp ==
+ * NULL) then we also have to track. See the
* comment in rotatelog. We need to allow for
- * the case where the logname is not the same
- * as the log file name.
+ * the case where the logname is not the same as
+ * the log file name.
*/
fillconflist(lineno, entry, opts, comment, 0);
}
diff --git a/usr/src/lib/libnvpair/Makefile.com b/usr/src/lib/libnvpair/Makefile.com
index 056d967554..1e5d247371 100644
--- a/usr/src/lib/libnvpair/Makefile.com
+++ b/usr/src/lib/libnvpair/Makefile.com
@@ -72,6 +72,9 @@ CERRWARN += -_gcc=-Wno-uninitialized
CFLAGS += $(CCVERBOSE)
CPPFLAGS += -D_REENTRANT
+C99MODE= -xc99=%all
+C99LMODE= -Xc99=%all
+
$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
.KEEP_STATE:
diff --git a/usr/src/lib/libnvpair/nvpair_json.c b/usr/src/lib/libnvpair/nvpair_json.c
index 77348041ab..39f036fbc3 100644
--- a/usr/src/lib/libnvpair/nvpair_json.c
+++ b/usr/src/lib/libnvpair/nvpair_json.c
@@ -20,11 +20,9 @@
#include "libnvpair.h"
-#define FPRINTF(fp, ...) \
- do { \
- if (fprintf(fp, __VA_ARGS__) < 0) \
- return (-1); \
- } while (0)
+#define FPRINTF(fp, ...) \
+ if (fprintf(fp, __VA_ARGS__) < 0) \
+ return (-1) \
/*
* When formatting a string for JSON output we must escape certain characters,
@@ -83,13 +81,13 @@ nvlist_print_json_string(FILE *fp, const char *input)
* characters in the Basic Multilingual Plane
* as JSON-escaped multibyte characters.
*/
- FPRINTF(fp, "\\u%04x", 0xffff & c);
+ FPRINTF(fp, "\\u%04x", (int)(0xffff & c));
} else if (c >= 0x20 && c <= 0x7f) {
/*
* Render other 7-bit ASCII characters directly
* and drop other, unrepresentable characters.
*/
- FPRINTF(fp, "%c", 0xff & c);
+ FPRINTF(fp, "%c", (int)(0xff & c));
}
break;
}
@@ -189,19 +187,21 @@ nvlist_print_json(FILE *fp, nvlist_t *nvl)
}
case DATA_TYPE_INT64: {
- FPRINTF(fp, "%lld", fnvpair_value_int64(curr));
+ FPRINTF(fp, "%lld",
+ (long long)fnvpair_value_int64(curr));
break;
}
case DATA_TYPE_UINT64: {
- FPRINTF(fp, "%llu", fnvpair_value_uint64(curr));
+ FPRINTF(fp, "%llu",
+ (unsigned long long)fnvpair_value_uint64(curr));
break;
}
case DATA_TYPE_HRTIME: {
hrtime_t val;
VERIFY0(nvpair_value_hrtime(curr, &val));
- FPRINTF(fp, "%llu", val);
+ FPRINTF(fp, "%llu", (unsigned long long)val);
break;
}
@@ -370,7 +370,8 @@ nvlist_print_json(FILE *fp, nvlist_t *nvl)
for (i = 0; i < valsz; i++) {
if (i > 0)
FPRINTF(fp, ",");
- FPRINTF(fp, "%llu", val[i]);
+ FPRINTF(fp, "%llu",
+ (unsigned long long)val[i]);
}
FPRINTF(fp, "]");
break;
@@ -384,7 +385,7 @@ nvlist_print_json(FILE *fp, nvlist_t *nvl)
for (i = 0; i < valsz; i++) {
if (i > 0)
FPRINTF(fp, ",");
- FPRINTF(fp, "%lld", val[i]);
+ FPRINTF(fp, "%lld", (long long)val[i]);
}
FPRINTF(fp, "]");
break;
diff --git a/usr/src/lib/libshare/autofs/libshare_autofs.c b/usr/src/lib/libshare/autofs/libshare_autofs.c
index 2e0e7b85d7..8098a6e36e 100644
--- a/usr/src/lib/libshare/autofs/libshare_autofs.c
+++ b/usr/src/lib/libshare/autofs/libshare_autofs.c
@@ -594,7 +594,5 @@ autofs_features(void)
static char *
autofs_get_status(void)
{
- char *state = NULL;
- state = smf_get_state(AUTOFS_DEFAULT_FMRI);
- return (state != NULL ? state : strdup("-"));
+ return (smf_get_state(AUTOFS_DEFAULT_FMRI));
}
diff --git a/usr/src/lib/libshare/nfs/libshare_nfs.c b/usr/src/lib/libshare/nfs/libshare_nfs.c
index 0cf69a241a..3b8fddd327 100644
--- a/usr/src/lib/libshare/nfs/libshare_nfs.c
+++ b/usr/src/lib/libshare/nfs/libshare_nfs.c
@@ -3017,9 +3017,7 @@ nfs_set_proto_prop(sa_property_t prop)
static char *
nfs_get_status()
{
- char *state;
- state = smf_get_state(NFSD);
- return (state != NULL ? state : strdup("-"));
+ return (smf_get_state(NFSD));
}
/*
diff --git a/usr/src/lib/libshare/smb/libshare_smb.c b/usr/src/lib/libshare/smb/libshare_smb.c
index 2c6509f06b..86fd29bada 100644
--- a/usr/src/lib/libshare/smb/libshare_smb.c
+++ b/usr/src/lib/libshare/smb/libshare_smb.c
@@ -1579,9 +1579,7 @@ smb_set_proto_prop(sa_property_t prop)
static char *
smb_get_status(void)
{
- char *state = NULL;
- state = smf_get_state(SMBD_DEFAULT_INSTANCE_FMRI);
- return (state != NULL ? state : strdup("-"));
+ return (smf_get_state(SMBD_DEFAULT_INSTANCE_FMRI));
}
/*
diff --git a/usr/src/lib/libshare/smbfs/libshare_smbfs.c b/usr/src/lib/libshare/smbfs/libshare_smbfs.c
index 1d81fadfbe..b1f19f917d 100644
--- a/usr/src/lib/libshare/smbfs/libshare_smbfs.c
+++ b/usr/src/lib/libshare/smbfs/libshare_smbfs.c
@@ -683,9 +683,7 @@ smbfs_set_proto_prop(sa_property_t prop)
static char *
smbfs_get_status()
{
- char *state = "enabled";
- state = smf_get_state(SMBC_DEFAULT_INSTANCE_FMRI);
- return (state != NULL ? state : strdup("-"));
+ return (smf_get_state(SMBC_DEFAULT_INSTANCE_FMRI));
}
/*
diff --git a/usr/src/lib/libuuid/common/uuid.c b/usr/src/lib/libuuid/common/uuid.c
index 7369a56894..d0601e4fbf 100644
--- a/usr/src/lib/libuuid/common/uuid.c
+++ b/usr/src/lib/libuuid/common/uuid.c
@@ -368,18 +368,18 @@ fill_random_bytes(uchar_t *buf, int nbytes)
int i;
if (fd_urand == -1) {
- mutex_lock(&urandmtx);
+ (void) mutex_lock(&urandmtx);
/* check again now that we have the mutex */
if (fd_urand == -1) {
if ((fd_urand = open(URANDOM_PATH, O_RDONLY)) >= 0)
load_cache();
}
- mutex_unlock(&urandmtx);
+ (void) mutex_unlock(&urandmtx);
}
if (fd_urand >= 0 && rcachep != NULL) {
int cnt;
- mutex_lock(&urandmtx);
+ (void) mutex_lock(&urandmtx);
if (rcachep != NULL &&
(rcachep + nbytes) >= (rcache + RCACHE_SIZE))
load_cache();
@@ -387,10 +387,10 @@ fill_random_bytes(uchar_t *buf, int nbytes)
if (rcachep != NULL) {
for (cnt = 0; cnt < nbytes; cnt++)
*buf++ = *rcachep++;
- mutex_unlock(&urandmtx);
+ (void) mutex_unlock(&urandmtx);
return;
}
- mutex_unlock(&urandmtx);
+ (void) mutex_unlock(&urandmtx);
}
for (i = 0; i < nbytes; i++) {
*buf++ = get_random() & 0xFF;
@@ -540,13 +540,13 @@ uuid_generate(uuid_t uu)
return;
}
if (fd_urand == -1) {
- mutex_lock(&urandmtx);
+ (void) mutex_lock(&urandmtx);
/* check again now that we have the mutex */
if (fd_urand == -1) {
if ((fd_urand = open(URANDOM_PATH, O_RDONLY)) >= 0)
load_cache();
}
- mutex_unlock(&urandmtx);
+ (void) mutex_unlock(&urandmtx);
}
if (fd_urand >= 0) {
uuid_generate_random(uu);