summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2013-11-07 00:14:05 +0000
committerRobert Mustacchi <rm@joyent.com>2014-01-14 13:31:17 -0800
commit652601fb657e961ff66dadcd87ddfc146c5db0ca (patch)
tree2c2f303f4620df511445cd0370385d19d59c9ee3
parent96ab4d5390a62b7e1743ec1fad5c0eef9682b961 (diff)
downloadillumos-joyent-652601fb657e961ff66dadcd87ddfc146c5db0ca.tar.gz
4295 libshare sa_get_proto_status sometimes returns unallocated strings
Reviewed by: Marcel Telka <marcel@telka.sk> Approved by: Garrett D'Amore <garrett@damore.org>
-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
4 files changed, 4 insertions, 12 deletions
diff --git a/usr/src/lib/libshare/autofs/libshare_autofs.c b/usr/src/lib/libshare/autofs/libshare_autofs.c
index aace8fd4da..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 : "-");
+ 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 37ea8cdf3d..90cb9624e7 100644
--- a/usr/src/lib/libshare/nfs/libshare_nfs.c
+++ b/usr/src/lib/libshare/nfs/libshare_nfs.c
@@ -3009,9 +3009,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 76c9eb0909..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 : "-");
+ 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));
}
/*