diff options
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/cmd/cmd-crypto/kmfcfg/kmfcfg.c | 19 | ||||
-rw-r--r-- | usr/src/cmd/dtrace/test/cmd/jdtrace/jdtrace.c | 2 | ||||
-rw-r--r-- | usr/src/cmd/mdb/common/kmdb/kmdb_kvm.c | 3 | ||||
-rw-r--r-- | usr/src/cmd/mdb/common/mdb/mdb.c | 4 | ||||
-rw-r--r-- | usr/src/cmd/mdb/common/mdb/mdb_cmds.c | 10 | ||||
-rw-r--r-- | usr/src/cmd/mdb/common/mdb/mdb_nm.c | 6 | ||||
-rw-r--r-- | usr/src/cmd/mdb/common/mdb/mdb_proc.c | 3 | ||||
-rw-r--r-- | usr/src/cmd/mdb/common/mdb/mdb_tab.c | 53 | ||||
-rw-r--r-- | usr/src/cmd/mdb/common/modules/crypto/spi.c | 6 | ||||
-rw-r--r-- | usr/src/cmd/mdb/common/modules/fcp/fcp.c | 11 | ||||
-rw-r--r-- | usr/src/cmd/mdb/common/modules/fctl/fctl.c | 9 | ||||
-rw-r--r-- | usr/src/cmd/mdb/common/modules/genunix/ndievents.c | 31 | ||||
-rw-r--r-- | usr/src/cmd/mdb/common/modules/libumem/umem.c | 4 | ||||
-rw-r--r-- | usr/src/cmd/mdb/intel/mdb/proc_amd64dep.c | 2 | ||||
-rw-r--r-- | usr/src/cmd/mdb/intel/mdb/proc_ia32dep.c | 4 | ||||
-rw-r--r-- | usr/src/lib/libbe/common/be_utils.c | 5 | ||||
-rw-r--r-- | usr/src/lib/libproject/common/setproject.c | 8 |
17 files changed, 92 insertions, 88 deletions
diff --git a/usr/src/cmd/cmd-crypto/kmfcfg/kmfcfg.c b/usr/src/cmd/cmd-crypto/kmfcfg/kmfcfg.c index 04b7c8ae2e..92350ed22f 100644 --- a/usr/src/cmd/cmd-crypto/kmfcfg/kmfcfg.c +++ b/usr/src/cmd/cmd-crypto/kmfcfg/kmfcfg.c @@ -21,6 +21,10 @@ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. */ +/* + * Copyright (c) 2018, Joyent, Inc. + */ + #include <stdio.h> #include <strings.h> #include <ctype.h> @@ -38,9 +42,9 @@ * fix, and extend with new verbs. */ typedef struct verbcmd_s { - char *verb; + char *verb; int (*action)(int, char *[]); - char *synopsis; + char *synopsis; } verbcmd; int kc_list(int argc, char *argv[]); @@ -140,11 +144,11 @@ static verbcmd cmds[] = { "infile=inputdbfile\n" }, { "export", kc_export, "export [dbfile=dbfile] policy=policyname " "outfile=newdbfile\n" }, - { "install", kc_install, "install keystore=keystorename " + { "install", kc_install, "install keystore=keystorename " "modulepath=path [option=optionstring]\n"}, - { "uninstall", kc_uninstall, "uninstall keystore=keystorename\n"}, - { "-?", kc_help, "help"}, - { "help", kc_help, ""} + { "uninstall", kc_uninstall, "uninstall keystore=keystorename\n"}, + { "-?", kc_help, "help"}, + { "help", kc_help, ""} }; static int num_cmds = sizeof (cmds) / sizeof (verbcmd); @@ -189,7 +193,8 @@ main(int argc, char *argv[]) (void) textdomain(TEXT_DOMAIN); prog = basename(argv[0]); - argv++; argc--; + argv++; + argc--; if (argc == 0) { usage(); diff --git a/usr/src/cmd/dtrace/test/cmd/jdtrace/jdtrace.c b/usr/src/cmd/dtrace/test/cmd/jdtrace/jdtrace.c index 81a2d9bcdf..cb37fb77d7 100644 --- a/usr/src/cmd/dtrace/test/cmd/jdtrace/jdtrace.c +++ b/usr/src/cmd/dtrace/test/cmd/jdtrace/jdtrace.c @@ -55,7 +55,7 @@ main(int argc, char **argv) p[i] = NULL; if (sysinfo(SI_ARCHITECTURE_64, isaname, sizeof (isaname)) != -1) - asprintf(av, "/usr/java/bin/%s/java", isaname); + (void) asprintf(av, "/usr/java/bin/%s/java", isaname); (void) execv(av[0], av); err(1, "exec failed"); diff --git a/usr/src/cmd/mdb/common/kmdb/kmdb_kvm.c b/usr/src/cmd/mdb/common/kmdb/kmdb_kvm.c index 95e309e58c..60b06e8456 100644 --- a/usr/src/cmd/mdb/common/kmdb/kmdb_kvm.c +++ b/usr/src/cmd/mdb/common/kmdb/kmdb_kvm.c @@ -2389,8 +2389,7 @@ kmt_destroy(mdb_tgt_t *t) if (kmt->kmt_trapmap != NULL) mdb_free(kmt->kmt_trapmap, BT_SIZEOFMAP(kmt->kmt_trapmax)); - if (kmt != NULL) - mdb_free(kmt, sizeof (kmt_data_t)); + mdb_free(kmt, sizeof (kmt_data_t)); } static const mdb_tgt_ops_t kmt_ops = { diff --git a/usr/src/cmd/mdb/common/mdb/mdb.c b/usr/src/cmd/mdb/common/mdb/mdb.c index 5c1c5fc84a..eb6b46083f 100644 --- a/usr/src/cmd/mdb/common/mdb/mdb.c +++ b/usr/src/cmd/mdb/common/mdb/mdb.c @@ -24,7 +24,7 @@ */ /* * Copyright (c) 2012 by Delphix. All rights reserved. - * Copyright (c) 2012 Joyent, Inc. All rights reserved. + * Copyright (c) 2018, Joyent, Inc. */ /* @@ -1155,7 +1155,7 @@ mdb_call_tab(mdb_idcmd_t *idcp, mdb_tab_cookie_t *mcp, uint_t flags, if (idcp->idc_tabp == NULL) return; - idcp->idc_tabp(mcp, flags, argc, argv); + (void) idcp->idc_tabp(mcp, flags, argc, argv); } /* diff --git a/usr/src/cmd/mdb/common/mdb/mdb_cmds.c b/usr/src/cmd/mdb/common/mdb/mdb_cmds.c index 95584e6a89..8519415df1 100644 --- a/usr/src/cmd/mdb/common/mdb/mdb_cmds.c +++ b/usr/src/cmd/mdb/common/mdb/mdb_cmds.c @@ -26,7 +26,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. - * Copyright (c) 2018 Joyent, Inc. All rights reserved. + * Copyright (c) 2019 Joyent, Inc. All rights reserved. * Copyright (c) 2013 Josef 'Jeff' Sipek <jeffpc@josefsipek.net> * Copyright (c) 2015, 2017 by Delphix. All rights reserved. * Copyright 2018 OmniOS Community Edition (OmniOSce) Association. @@ -1520,9 +1520,9 @@ map_name(const mdb_map_t *map, const char *name) return ("[ stack ]"); if (map->map_flags & MDB_TGT_MAP_ANON) return ("[ anon ]"); - if (map->map_name != NULL) - return (map->map_name); - return ("[ unknown ]"); + if (map->map_name[0] == '\0') + return ("[ unknown ]"); + return (map->map_name); } /*ARGSUSED*/ @@ -2343,7 +2343,7 @@ cmd_head(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) const char *c; mdb_pipe_t p; - if (!flags & DCMD_PIPE) + if (!(flags & DCMD_PIPE)) return (DCMD_USAGE); if (argc == 1 || argc == 2) { diff --git a/usr/src/cmd/mdb/common/mdb/mdb_nm.c b/usr/src/cmd/mdb/common/mdb/mdb_nm.c index 2c427d1f59..0653075e54 100644 --- a/usr/src/cmd/mdb/common/mdb/mdb_nm.c +++ b/usr/src/cmd/mdb/common/mdb/mdb_nm.c @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2018, Joyent, Inc. + */ + #include <sys/elf.h> #include <sys/elf_SPARC.h> @@ -785,7 +789,7 @@ cmd_nm(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) for (symp = syms; nsyms-- != 0; symp++) { nii.nii_fp = symp->nm_fp; - callback(&nii, &symp->nm_sym, symp->nm_name, + (void) callback(&nii, &symp->nm_sym, symp->nm_name, &symp->nm_si, symp->nm_object); } diff --git a/usr/src/cmd/mdb/common/mdb/mdb_proc.c b/usr/src/cmd/mdb/common/mdb/mdb_proc.c index 33994c11e6..48f241b222 100644 --- a/usr/src/cmd/mdb/common/mdb/mdb_proc.c +++ b/usr/src/cmd/mdb/common/mdb/mdb_proc.c @@ -1990,8 +1990,7 @@ pt_env_set(pt_data_t *pt, const char *nameval) (void) mdb_nv_insert(&pt->p_env, name, NULL, (uintptr_t)val, MDB_NV_EXTNAME); - if (equals) - *equals = '='; + *equals = '='; } /* diff --git a/usr/src/cmd/mdb/common/mdb/mdb_tab.c b/usr/src/cmd/mdb/common/mdb/mdb_tab.c index 66bd18586e..cd6995f887 100644 --- a/usr/src/cmd/mdb/common/mdb/mdb_tab.c +++ b/usr/src/cmd/mdb/common/mdb/mdb_tab.c @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2013 by Delphix. All rights reserved. - * Copyright (c) 2012 Joyent, Inc. All rights reserved. + * Copyright (c) 2018, Joyent, Inc. * Copyright (c) 2013 Josef 'Jeff' Sipek <jeffpc@josefsipek.net> */ /* @@ -57,7 +57,7 @@ /* * find_command_start -- * - * Given a buffer find the start of the last command. + * Given a buffer find the start of the last command. */ static char * tab_find_command_start(char *buf) @@ -82,11 +82,11 @@ tab_find_command_start(char *buf) /* * get_dcmd -- * - * Given a buffer containing a command and its argument return - * the name of the command and the offset in the buffer where - * the command arguments start. + * Given a buffer containing a command and its argument return + * the name of the command and the offset in the buffer where + * the command arguments start. * - * Note: This will modify the buffer. + * Note: This will modify the buffer. */ char * tab_get_dcmd(char *buf, char **args, uint_t *flags) @@ -118,11 +118,11 @@ tab_get_dcmd(char *buf, char **args, uint_t *flags) /* * count_args -- * - * Given a buffer containing dmcd arguments return the total number - * of arguments. + * Given a buffer containing dmcd arguments return the total number + * of arguments. * - * While parsing arguments we need to keep track of whether or not the last - * arguments ends with a trailing space. + * While parsing arguments we need to keep track of whether or not the last + * arguments ends with a trailing space. */ static int tab_count_args(const char *input, uint_t *flags) @@ -158,10 +158,10 @@ tab_count_args(const char *input, uint_t *flags) /* * copy_args -- * - * Given a buffer containing dcmd arguments and an array of mdb_arg_t's - * initialize the string value of each mdb_arg_t. + * Given a buffer containing dcmd arguments and an array of mdb_arg_t's + * initialize the string value of each mdb_arg_t. * - * Note: This will modify the buffer. + * Note: This will modify the buffer. */ static int tab_copy_args(char *input, int argc, mdb_arg_t *argv) @@ -204,12 +204,12 @@ tab_copy_args(char *input, int argc, mdb_arg_t *argv) /* * parse-buf -- * - * Parse the given buffer and return the specified dcmd, the number - * of arguments, and array of mdb_arg_t containing the argument - * values. + * Parse the given buffer and return the specified dcmd, the number + * of arguments, and array of mdb_arg_t containing the argument + * values. * - * Note: this will modify the specified buffer. Caller is responisble - * for freeing argvp. + * Note: this will modify the specified buffer. Caller is responisble + * for freeing argvp. */ static int tab_parse_buf(char *buf, char **dcmdp, int *argcp, mdb_arg_t **argvp, @@ -253,9 +253,9 @@ tab_parse_buf(char *buf, char **dcmdp, int *argcp, mdb_arg_t **argvp, /* * tab_command -- * - * This function is executed anytime a tab is entered. It checks - * the current buffer to determine if there is a valid dmcd, - * if that dcmd has a tab completion handler it will invoke it. + * This function is executed anytime a tab is entered. It checks + * the current buffer to determine if there is a valid dmcd, + * if that dcmd has a tab completion handler it will invoke it. * * This function returns the string (if any) that should be added to the * existing buffer to complete it. @@ -398,8 +398,7 @@ mdb_tab_insert(mdb_tab_cookie_t *mcp, const char *name) * If we have a match set, then we want to verify that we actually match * it. */ - if (mcp->mtc_base != NULL && - strncmp(name, mcp->mtc_base, strlen(mcp->mtc_base)) != 0) + if (strncmp(name, mcp->mtc_base, strlen(mcp->mtc_base)) != 0) return; v = mdb_nv_lookup(&mcp->mtc_nv, name); @@ -438,13 +437,7 @@ mdb_tab_print(mdb_tab_cookie_t *mcp) const char * mdb_tab_match(mdb_tab_cookie_t *mcp) { - size_t blen; - - if (mcp->mtc_base == NULL) - blen = 0; - else - blen = strlen(mcp->mtc_base); - return (mcp->mtc_match + blen); + return (mcp->mtc_match + strlen(mcp->mtc_base)); } void diff --git a/usr/src/cmd/mdb/common/modules/crypto/spi.c b/usr/src/cmd/mdb/common/modules/crypto/spi.c index 775884f358..2c28720110 100644 --- a/usr/src/cmd/mdb/common/modules/crypto/spi.c +++ b/usr/src/cmd/mdb/common/modules/crypto/spi.c @@ -24,6 +24,10 @@ */ /* + * Copyright (c) 2018, Joyent, Inc. + */ + +/* * mdb dcmds for selected structures from * usr/src/uts/common/sys/crypto/spi.h * @@ -191,7 +195,7 @@ crypto_mech_info(uintptr_t addr, uint_t flags, int argc, crypto_mech_info_t minfo; const char *unit = "bits"; - if (! flags & DCMD_ADDRSPEC) + if (!(flags & DCMD_ADDRSPEC)) return (DCMD_USAGE); if (mdb_vread(&minfo, sizeof (crypto_mech_info_t), addr) diff --git a/usr/src/cmd/mdb/common/modules/fcp/fcp.c b/usr/src/cmd/mdb/common/modules/fcp/fcp.c index 0b9f2dc90f..a16e3a1308 100644 --- a/usr/src/cmd/mdb/common/modules/fcp/fcp.c +++ b/usr/src/cmd/mdb/common/modules/fcp/fcp.c @@ -22,7 +22,7 @@ * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * - * FCP mdb module + * Copyright (c) 2018, Joyent, Inc. */ @@ -328,8 +328,8 @@ targets_walk_i(mdb_walk_state_t *wsp) tgt_hash_index = 0; - while ((port.port_tgt_hash_table[tgt_hash_index] == NULL) && - (tgt_hash_index < FCP_NUM_HASH)) { + while (tgt_hash_index < FCP_NUM_HASH && + port.port_tgt_hash_table[tgt_hash_index] == NULL) { tgt_hash_index++; } @@ -369,10 +369,9 @@ targets_walk_s(mdb_walk_state_t *wsp) tgt_hash_index++; - while ((port.port_tgt_hash_table[tgt_hash_index] == NULL) && - (tgt_hash_index < FCP_NUM_HASH)) { + while (tgt_hash_index < FCP_NUM_HASH && + port.port_tgt_hash_table[tgt_hash_index] == NULL) tgt_hash_index++; - } if (tgt_hash_index == FCP_NUM_HASH) { /* You're done */ diff --git a/usr/src/cmd/mdb/common/modules/fctl/fctl.c b/usr/src/cmd/mdb/common/modules/fctl/fctl.c index 8e135fbf34..89a8139c83 100644 --- a/usr/src/cmd/mdb/common/modules/fctl/fctl.c +++ b/usr/src/cmd/mdb/common/modules/fctl/fctl.c @@ -23,6 +23,9 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2018, Joyent, Inc. + */ #include <sys/mdb_modapi.h> #include <sys/mutex.h> @@ -244,7 +247,7 @@ ulp_walk_f(mdb_walk_state_t *wsp) static int ulps(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) { - fc_ulp_list_t ulplist; + fc_ulp_list_t ulplist; fc_ulp_modinfo_t ulp; char ulp_name[30]; @@ -354,7 +357,7 @@ ulpmod_walk_f(mdb_walk_state_t *wsp) static int ulpmods(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) { - fc_ulp_module_t modlist; + fc_ulp_module_t modlist; fc_ulp_modinfo_t modinfo; fc_ulp_ports_t ulp_port; @@ -1109,7 +1112,7 @@ fc_trace_dump(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) return (DCMD_USAGE); } - if (logq.il_flags & FC_TRACE_LOGQ_V2 != 0) { + if ((logq.il_flags & FC_TRACE_LOGQ_V2) != 0) { rval = fc_dump_logmsg((fc_trace_dmsg_t *)logq.il_msgh, pktstart, pktend, &printed); } else { diff --git a/usr/src/cmd/mdb/common/modules/genunix/ndievents.c b/usr/src/cmd/mdb/common/modules/genunix/ndievents.c index 764250520e..ed31a9c559 100644 --- a/usr/src/cmd/mdb/common/modules/genunix/ndievents.c +++ b/usr/src/cmd/mdb/common/modules/genunix/ndievents.c @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2018, Joyent, Inc. + */ #include "ndievents.h" #include <sys/sunndi.h> @@ -36,8 +38,8 @@ int -dip_to_pathname(struct dev_info *device, char *path, int buflen) { - +dip_to_pathname(struct dev_info *device, char *path, int buflen) +{ char *bp; char *addr; char addr_str[32]; @@ -52,7 +54,7 @@ dip_to_pathname(struct dev_info *device, char *path, int buflen) { if (device->devi_parent == NULL) { if (mdb_readstr(nodename, sizeof (nodename), (uintptr_t)device->devi_node_name) == -1) { - return (-1); + return (-1); } if (sizeof (nodename) > (buflen - strlen(path))) { @@ -80,7 +82,7 @@ dip_to_pathname(struct dev_info *device, char *path, int buflen) { } if (device->devi_node_state < DS_INITIALIZED) { - strncpy(addr_str, '\0', sizeof ('\0')); + addr_str[0] = '\0'; } else { addr = device->devi_addr; if (mdb_readstr(addr_str, sizeof (addr_str), @@ -119,7 +121,7 @@ ndi_callback_print(struct ndi_event_cookie *cookie, uint_t flags) while (callback_list != NULL) { if (mdb_vread(&cb, sizeof (struct ndi_event_callbacks), - (uintptr_t)callback_list) == -1) { + (uintptr_t)callback_list) == -1) { mdb_warn("Could not read callback structure at" " %p", callback_list); return (DCMD_ERR); @@ -156,10 +158,10 @@ int ndi_event_print(struct ndi_event_hdl *hdl, uint_t flags) { - struct ndi_event_definition def; - struct ndi_event_cookie cookie; - struct ndi_event_cookie *cookie_list; - char ndi_event_name[256]; + struct ndi_event_definition def; + struct ndi_event_cookie cookie; + struct ndi_event_cookie *cookie_list; + char ndi_event_name[256]; if (!hdl) return (DCMD_ERR); @@ -222,8 +224,7 @@ ndi_event_hdl(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) } if (mdb_vread(&devi, sizeof (struct dev_info), - (uintptr_t)handle.ndi_evthdl_dip) - == -1) { + (uintptr_t)handle.ndi_evthdl_dip) == -1) { mdb_warn("failed to read devinfo node at %p", handle.ndi_evthdl_dip); return (DCMD_ERR); @@ -250,9 +251,9 @@ ndi_event_hdl(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) addr = (uintptr_t)handle.ndi_next_hdl; if (mdb_vread(&handle, sizeof (struct ndi_event_hdl), (uintptr_t)addr) == -1) { - mdb_warn("failed to read ndi_event_hdl at %p", - addr); - break; + mdb_warn("failed to read ndi_event_hdl at %p", + addr); + break; } } diff --git a/usr/src/cmd/mdb/common/modules/libumem/umem.c b/usr/src/cmd/mdb/common/modules/libumem/umem.c index 65a06cb31c..43b6ea3458 100644 --- a/usr/src/cmd/mdb/common/modules/libumem/umem.c +++ b/usr/src/cmd/mdb/common/modules/libumem/umem.c @@ -24,7 +24,7 @@ */ /* - * Copyright 2012 Joyent, Inc. All rights reserved. + * Copyright (c) 2018, Joyent, Inc. * Copyright (c) 2013, 2015 by Delphix. All rights reserved. */ @@ -2116,7 +2116,7 @@ whatis_walk_seg(uintptr_t addr, const vmem_seg_t *vs, whatis_info_t *wi) (vs->vs_type == VMEM_ALLOC) ? "allocated" : "freed", wi->wi_vmem->vm_name); - if (!mdb_whatis_flags(w) & WHATIS_QUIET) + if (!(mdb_whatis_flags(w) & WHATIS_QUIET)) whatis_call_printer(vmem_seg, addr); else mdb_printf("\n"); diff --git a/usr/src/cmd/mdb/intel/mdb/proc_amd64dep.c b/usr/src/cmd/mdb/intel/mdb/proc_amd64dep.c index a2f401d74c..254ccf5af1 100644 --- a/usr/src/cmd/mdb/intel/mdb/proc_amd64dep.c +++ b/usr/src/cmd/mdb/intel/mdb/proc_amd64dep.c @@ -311,8 +311,6 @@ fpcw2str(uint32_t cw, char *buf, size_t nbytes) /* * Decode precision, rounding, and infinity options in control word. */ - if (cw & FPSIG24) - p += mdb_snprintf(p, (size_t)(end - p), "|SIG24"); if (cw & FPSIG53) p += mdb_snprintf(p, (size_t)(end - p), "|SIG53"); if (cw & FPSIG64) diff --git a/usr/src/cmd/mdb/intel/mdb/proc_ia32dep.c b/usr/src/cmd/mdb/intel/mdb/proc_ia32dep.c index fe207df5f4..4efba18e4b 100644 --- a/usr/src/cmd/mdb/intel/mdb/proc_ia32dep.c +++ b/usr/src/cmd/mdb/intel/mdb/proc_ia32dep.c @@ -24,7 +24,7 @@ * Use is subject to license terms. */ /* - * Copyright 2018 Joyent, Inc. + * Copyright (c) 2018, Joyent, Inc. */ /* @@ -252,8 +252,6 @@ fpcw2str(uint32_t cw, char *buf, size_t nbytes) /* * Decode precision, rounding, and infinity options in control word. */ - if (cw & FPSIG24) - p += mdb_snprintf(p, (size_t)(end - p), "|SIG24"); if (cw & FPSIG53) p += mdb_snprintf(p, (size_t)(end - p), "|SIG53"); if (cw & FPSIG64) diff --git a/usr/src/lib/libbe/common/be_utils.c b/usr/src/lib/libbe/common/be_utils.c index b29120c824..73eb416043 100644 --- a/usr/src/lib/libbe/common/be_utils.c +++ b/usr/src/lib/libbe/common/be_utils.c @@ -25,6 +25,7 @@ * Copyright 2016 Toomas Soome <tsoome@me.com> * Copyright (c) 2015 by Delphix. All rights reserved. * Copyright 2018 OmniOS Community Edition (OmniOSce) Association. + * Copyright (c) 2018, Joyent, Inc. */ @@ -270,7 +271,7 @@ be_get_boot_args(char **fbarg, int entry) "-B zfs-bootfs=%s,bootpath=\"%s\"\n", kernel, kernel_options, node->be_root_ds, tmp); - if (fbarg == NULL) + if (*fbarg == NULL) ret = BE_ERR_NOMEM; else ret = 0; @@ -3908,9 +3909,9 @@ be_create_menu( if (mkdirp(menu_path, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == -1 && errno != EEXIST) { - free(menu_path); be_print_err(gettext("be_create_menu: Failed to create the %s " "directory: %s\n"), menu_path, strerror(errno)); + free(menu_path); return (errno_to_be_err(errno)); } free(menu_path); diff --git a/usr/src/lib/libproject/common/setproject.c b/usr/src/lib/libproject/common/setproject.c index ef208845a1..f2ca827ee2 100644 --- a/usr/src/lib/libproject/common/setproject.c +++ b/usr/src/lib/libproject/common/setproject.c @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright (c) 2018, Joyent, Inc. */ @@ -501,7 +501,7 @@ bind_to_pool(const char *pool_name, pid_t pid, int force) * 'system.bind-default' = 'true'. */ if ((pvals[0] = pool_value_alloc()) == NULL) { - pool_conf_close(conf); + (void) pool_conf_close(conf); pool_conf_free(conf); return (-1); } @@ -510,7 +510,7 @@ bind_to_pool(const char *pool_name, pid_t pid, int force) pool_value_get_bool(pvals[0], &bval) != PO_SUCCESS || bval == PO_FALSE) { pool_value_free(pvals[0]); - pool_conf_close(conf); + (void) pool_conf_close(conf); pool_conf_free(conf); errno = pool_name == NULL ? EACCES : ESRCH; return (-1); @@ -522,7 +522,7 @@ bind_to_pool(const char *pool_name, pid_t pid, int force) * No default pools exist. */ pool_value_free(pvals[0]); - pool_conf_close(conf); + (void) pool_conf_close(conf); pool_conf_free(conf); errno = pool_name == NULL ? EACCES : ESRCH; return (-1); |