diff options
-rw-r--r-- | usr/src/boot/include/stdlib.h | 3 | ||||
-rw-r--r-- | usr/src/lib/fm/libdiskstatus/common/ds_scsi_uscsi.c | 8 | ||||
-rw-r--r-- | usr/src/lib/libmail/common/notifyu.c | 12 | ||||
-rw-r--r-- | usr/src/lib/libsasl/lib/common.c | 2 | ||||
-rw-r--r-- | usr/src/tools/scripts/git-pbchk.py | 4 |
5 files changed, 14 insertions, 15 deletions
diff --git a/usr/src/boot/include/stdlib.h b/usr/src/boot/include/stdlib.h index d5506ff65e..b8708a27a5 100644 --- a/usr/src/boot/include/stdlib.h +++ b/usr/src/boot/include/stdlib.h @@ -172,8 +172,7 @@ char *realpath(const char * __restrict, char * __restrict); int rand_r(unsigned *); /* (TSF) */ #endif #if __POSIX_VISIBLE >= 200112 -int posix_memalign(void **, size_t, size_t) __nonnull(1) __alloc_align(2) - __alloc_size(3); /* (ADV) */ +int posix_memalign(void **, size_t, size_t); /* (ADV) */ int setenv(const char *, const char *, int); int unsetenv(const char *); #endif diff --git a/usr/src/lib/fm/libdiskstatus/common/ds_scsi_uscsi.c b/usr/src/lib/fm/libdiskstatus/common/ds_scsi_uscsi.c index 1c73c959ea..3211e65dfc 100644 --- a/usr/src/lib/fm/libdiskstatus/common/ds_scsi_uscsi.c +++ b/usr/src/lib/fm/libdiskstatus/common/ds_scsi_uscsi.c @@ -1615,12 +1615,13 @@ uscsi_log_sense(int fd, int page_code, int page_control, caddr_t page_data, if (page_size < sizeof (scsi_log_header_t)) return (-1); - log_sense_buf = alloca((uint_t)page_size); + log_sense_buf = calloc(1, page_size); + if (log_sense_buf == NULL) + return (-1); /* * Build and execute the uscsi ioctl */ - (void) memset(log_sense_buf, 0, page_size); (void) memset((char *)&ucmd, 0, sizeof (ucmd)); (void) memset((char *)&cdb, 0, sizeof (union scsi_cdb)); cdb.scc_cmd = SCMD_LOG_SENSE_G1; @@ -1633,6 +1634,7 @@ uscsi_log_sense(int fd, int page_code, int page_control, caddr_t page_data, status = uscsi_cmd(fd, &ucmd, rqbuf, rqblen); if (status) { dprintf("Log sense page 0x%x failed\n", page_code); + free(log_sense_buf); return (-1); } @@ -1651,6 +1653,7 @@ uscsi_log_sense(int fd, int page_code, int page_control, caddr_t page_data, dprintf("\nLog sense page 0x%x: incorrect page code 0x%x\n", page_code, hdr->lh_code); ddump("Log sense:", log_sense_buf, page_size); + free(log_sense_buf); return (-1); } @@ -1672,6 +1675,7 @@ uscsi_log_sense(int fd, int page_code, int page_control, caddr_t page_data, sizeof (scsi_log_header_t)); ddump("data:", (caddr_t)hdr + sizeof (scsi_log_header_t), len); + free(log_sense_buf); return (0); } diff --git a/usr/src/lib/libmail/common/notifyu.c b/usr/src/lib/libmail/common/notifyu.c index 9d4b7d4694..1cbeb583fc 100644 --- a/usr/src/lib/libmail/common/notifyu.c +++ b/usr/src/lib/libmail/common/notifyu.c @@ -25,9 +25,7 @@ */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ - -#pragma ident "%Z%%M% %I% %E% SMI" +/* All Rights Reserved */ #include "libmail.h" #include <sys/types.h> @@ -41,12 +39,10 @@ typedef void (*SIG_PF) (int); #include <unistd.h> #include <signal.h> -static SIG_PF catcher(void); - -static SIG_PF catcher(void) +static void +catcher(int arg __unused) { /* do nothing, but allow the write() to break */ - return (0); } void @@ -77,7 +73,7 @@ notify(char *user, char *msg, int check_mesg_y, char *etcdir) (void) sprintf(dev, "%s/dev/%s", etcdir, tty); /* break out if write() to the tty hangs */ - old = (SIG_PF)signal(SIGALRM, (SIG_PF)catcher); + old = (SIG_PF)signal(SIGALRM, catcher); oldalarm = alarm(300); /* check if device is really a tty */ diff --git a/usr/src/lib/libsasl/lib/common.c b/usr/src/lib/libsasl/lib/common.c index b4fe5d1d86..e91a5b5508 100644 --- a/usr/src/lib/libsasl/lib/common.c +++ b/usr/src/lib/libsasl/lib/common.c @@ -1301,7 +1301,7 @@ static reg_list_t *reg_list_base = NULL; int _is_sun_reg(void *mech) { - reg_list_t *r, *prev; + reg_list_t *r, *prev = NULL; int is_reg = 0; LOCK_MUTEX(®_mutex); diff --git a/usr/src/tools/scripts/git-pbchk.py b/usr/src/tools/scripts/git-pbchk.py index 99bce29087..ec01255c6e 100644 --- a/usr/src/tools/scripts/git-pbchk.py +++ b/usr/src/tools/scripts/git-pbchk.py @@ -21,7 +21,7 @@ # Copyright (c) 2015, 2016 by Delphix. All rights reserved. # Copyright 2016 Nexenta Systems, Inc. # Copyright (c) 2019, Joyent, Inc. -# Copyright 2019 OmniOS Community Edition (OmniOSce) Association. +# Copyright 2020 OmniOS Community Edition (OmniOSce) Association. # from __future__ import print_function @@ -280,7 +280,7 @@ def jstyle(root, parent, flist, output): ret = 0 output.write("Java style:\n") for f in flist(lambda x: x.endswith('.java')): - with io.open(f, encoding='utf-8', errors='replace') as fh: + with io.open(f, mode='rb') as fh: ret |= JStyle.jstyle(fh, output=output, picky=True) return ret |