summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_hc.c14
-rw-r--r--usr/src/cmd/fs.d/deffs.c45
-rw-r--r--usr/src/cmd/fs.d/mount.c14
-rw-r--r--usr/src/common/nvpair/nvpair.c1
4 files changed, 43 insertions, 31 deletions
diff --git a/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_hc.c b/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_hc.c
index b7d7152a41..83c833738c 100644
--- a/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_hc.c
+++ b/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_hc.c
@@ -1264,7 +1264,9 @@ static boolean_t
ilbd_run_probe(ilbd_hc_srv_t *srv)
{
posix_spawn_file_actions_t fd_actions;
+ boolean_t init_fd_actions = B_FALSE;
posix_spawnattr_t attr;
+ boolean_t init_attr = B_FALSE;
sigset_t child_sigset;
int fds[2];
int fdflags;
@@ -1299,10 +1301,12 @@ ilbd_run_probe(ilbd_hc_srv_t *srv)
logdebug("ilbd_run_probe: posix_spawn_file_actions_init");
goto cleanup;
}
+ init_fd_actions = B_TRUE;
if (posix_spawnattr_init(&attr) != 0) {
logdebug("ilbd_run_probe: posix_spawnattr_init");
goto cleanup;
}
+ init_attr = B_TRUE;
if (posix_spawn_file_actions_addclose(&fd_actions, fds[0]) != 0) {
logdebug("ilbd_run_probe: posix_spawn_file_actions_addclose");
goto cleanup;
@@ -1356,7 +1360,6 @@ ilbd_run_probe(ilbd_hc_srv_t *srv)
}
(void) close(fds[1]);
- destroy_argv(child_argv);
srv->shc_child_pid = pid;
srv->shc_child_fd = fds[0];
srv->shc_ev = probe_ev;
@@ -1375,12 +1378,19 @@ ilbd_run_probe(ilbd_hc_srv_t *srv)
goto cleanup;
}
+ destroy_argv(child_argv);
+ (void) posix_spawn_file_actions_destroy(&fd_actions);
+ (void) posix_spawnattr_destroy(&attr);
return (B_TRUE);
cleanup:
+ destroy_argv(child_argv);
+ if (init_fd_actions == B_TRUE)
+ (void) posix_spawn_file_actions_destroy(&fd_actions);
+ if (init_attr == B_TRUE)
+ (void) posix_spawnattr_destroy(&attr);
(void) close(fds[0]);
(void) close(fds[1]);
- destroy_argv(child_argv);
if (probe_ev != NULL)
free(probe_ev);
return (B_FALSE);
diff --git a/usr/src/cmd/fs.d/deffs.c b/usr/src/cmd/fs.d/deffs.c
index ace3f9beb5..402106eae9 100644
--- a/usr/src/cmd/fs.d/deffs.c
+++ b/usr/src/cmd/fs.d/deffs.c
@@ -19,14 +19,17 @@
*
* CDDL HEADER END
*/
+
+/*
+ * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+ */
+
/* Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990, 1991, 1997 SMI */
/* All Rights Reserved */
-#ident "%Z%%M% %I% %E% SMI"
-
-#include <stdio.h>
-#include <deflt.h>
-#include <string.h>
+#include <stdio.h>
+#include <deflt.h>
+#include <string.h>
#define LOCAL "/etc/default/fs"
#define REMOTE "/etc/dfs/fstypes"
@@ -43,34 +46,24 @@
char *
default_fstype(char *special)
{
- char *deffs;
+ char *deffs = NULL;
static char buf[BUFSIZ];
FILE *fp;
if (*special == '/') {
- if (defopen(LOCAL) != 0)
- return ("ufs");
- else {
- if ((deffs = defread("LOCAL=")) == NULL) {
- defopen(NULL); /* close default file */
- return ("ufs");
- } else {
- defopen(NULL); /* close default file */
- return (deffs);
- }
+ if (defopen(LOCAL) == 0) {
+ deffs = defread("LOCAL=");
+ defopen(NULL); /* close default file */
}
} else {
- if ((fp = fopen(REMOTE, "r")) == NULL)
- return ("nfs");
- else {
- if (fgets(buf, sizeof (buf), fp) == NULL) {
- fclose(fp);
- return ("nfs");
- } else {
+ if ((fp = fopen(REMOTE, "r")) != NULL) {
+ if (fgets(buf, sizeof (buf), fp) != NULL)
deffs = strtok(buf, " \t\n");
- fclose(fp);
- return (deffs);
- }
+ fclose(fp);
}
+ if (deffs == NULL)
+ deffs = "nfs";
}
+
+ return (deffs != NULL ? deffs : "ufs");
}
diff --git a/usr/src/cmd/fs.d/mount.c b/usr/src/cmd/fs.d/mount.c
index 04a867b235..947767f5db 100644
--- a/usr/src/cmd/fs.d/mount.c
+++ b/usr/src/cmd/fs.d/mount.c
@@ -18,6 +18,11 @@
*
* CDDL HEADER END
*/
+
+/*
+ * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+ */
+
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
@@ -26,9 +31,6 @@
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-/*
- * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
- */
#include <stdio.h>
#include <stdio_ext.h>
@@ -1572,6 +1574,12 @@ check_fields(char *fstype, char *mountp)
{
struct stat64 stbuf;
+ if (fstype == NULL) {
+ fprintf(stderr,
+ gettext("%s: FSType cannot be determined\n"),
+ myname);
+ return (1);
+ }
if (strlen(fstype) > (size_t)FSTYPE_MAX) {
fprintf(stderr,
gettext("%s: FSType %s exceeds %d characters\n"),
diff --git a/usr/src/common/nvpair/nvpair.c b/usr/src/common/nvpair/nvpair.c
index 00d44263cc..977d262549 100644
--- a/usr/src/common/nvpair/nvpair.c
+++ b/usr/src/common/nvpair/nvpair.c
@@ -1231,6 +1231,7 @@ nvpair_type_is_array(nvpair_t *nvp)
data_type_t type = NVP_TYPE(nvp);
if ((type == DATA_TYPE_BYTE_ARRAY) ||
+ (type == DATA_TYPE_INT8_ARRAY) ||
(type == DATA_TYPE_UINT8_ARRAY) ||
(type == DATA_TYPE_INT16_ARRAY) ||
(type == DATA_TYPE_UINT16_ARRAY) ||