From 3e5de5d019b8b1edc6c40c035fa29f3a41341841 Mon Sep 17 00:00:00 2001 From: Eric Sproul Date: Tue, 28 Apr 2015 11:29:42 -0400 Subject: [PATCH] 5863 psiginfo arguments should be const Reviewed by: Andy Stormont Reviewed by: Garrett D'Amore Reviewed by: Dan McDonald Approved by: Garrett D'Amore --- usr/src/head/siginfo.h | 17 ++++++++++------- usr/src/lib/libc/port/gen/psiginfo.c | 7 ++++--- usr/src/lib/libc/port/llib-lc | 3 ++- usr/src/man/man3c/psignal.3c | 7 ++----- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/usr/src/head/siginfo.h b/usr/src/head/siginfo.h index 249f1163b8..869013dbaa 100644 --- a/usr/src/head/siginfo.h +++ b/usr/src/head/siginfo.h @@ -20,6 +20,9 @@ * CDDL HEADER END */ /* + * Copyright 2015 Circonus, Inc. All rights reserved. + */ +/* * Copyright 2014 Garrett D'Amore */ /* Copyright (c) 1988 AT&T */ @@ -40,17 +43,17 @@ struct siginfolist { char **vsiginfo; }; -extern const char * _sys_illlist[]; -extern const char * _sys_fpelist[]; -extern const char * _sys_segvlist[]; -extern const char * _sys_buslist[]; -extern const char * _sys_traplist[]; -extern const char * _sys_cldlist[]; +extern const char *_sys_illlist[]; +extern const char *_sys_fpelist[]; +extern const char *_sys_segvlist[]; +extern const char *_sys_buslist[]; +extern const char *_sys_traplist[]; +extern const char *_sys_cldlist[]; extern const struct siginfolist *_sys_siginfolistp; #define _sys_siginfolist _sys_siginfolistp extern void psignal(int, const char *); -extern void psiginfo(siginfo_t *, char *); +extern void psiginfo(const siginfo_t *, const char *); #ifdef __cplusplus } diff --git a/usr/src/lib/libc/port/gen/psiginfo.c b/usr/src/lib/libc/port/gen/psiginfo.c index 1675db36ee..a648c81094 100644 --- a/usr/src/lib/libc/port/gen/psiginfo.c +++ b/usr/src/lib/libc/port/gen/psiginfo.c @@ -18,6 +18,9 @@ * * CDDL HEADER END */ +/* + * Copyright 2015 Circonus, Inc. All rights reserved. + */ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. @@ -27,8 +30,6 @@ /* Copyright (c) 1988 AT&T */ /* All Rights Reserved */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Print the name of the siginfo indicated by "sig", along with the * supplied message @@ -46,7 +47,7 @@ #define strsignal(i) (_libc_gettext(_sys_siglistp[i])) void -psiginfo(siginfo_t *sip, char *s) +psiginfo(const siginfo_t *sip, const char *s) { char buf[256]; char *c; diff --git a/usr/src/lib/libc/port/llib-lc b/usr/src/lib/libc/port/llib-lc index 9f493e21d4..9fb5935f7c 100644 --- a/usr/src/lib/libc/port/llib-lc +++ b/usr/src/lib/libc/port/llib-lc @@ -25,6 +25,7 @@ * Copyright 2013 OmniTI Computer Consulting, Inc. All rights reserved. * Copyright (c) 2013 Gary Mills * Copyright 2014 Garrett D'Amore + * Copyright 2015 Circonus, Inc. All rights reserved. */ /* LINTLIBRARY */ @@ -760,7 +761,7 @@ void perror(const char *s); int pipe(int *fds); /* psiginfo.c */ -void psiginfo(siginfo_t *sip, char *s); +void psiginfo(const siginfo_t *sip, const char *s); /* psignal.c */ void psignal(int sig, const char *s); diff --git a/usr/src/man/man3c/psignal.3c b/usr/src/man/man3c/psignal.3c index 213c45f07f..655dedb022 100644 --- a/usr/src/man/man3c/psignal.3c +++ b/usr/src/man/man3c/psignal.3c @@ -1,5 +1,6 @@ '\" te .\" Copyright 1989 AT&T. Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved. +.\" Copyright 2015 Circonus, Inc. All rights reserved. .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] @@ -16,11 +17,10 @@ psignal, psiginfo \- system signal messages .LP .nf -\fBvoid\fR \fBpsiginfo\fR(\fBsiginfo_t *\fR\fIpinfo\fR, \fBchar *\fR\fIs\fR); +\fBvoid\fR \fBpsiginfo\fR(\fBconst siginfo_t *\fR\fIpinfo\fR, \fBconst char *\fR\fIs\fR); .fi .SH DESCRIPTION -.sp .LP The \fBpsignal()\fR and \fBpsiginfo()\fR functions produce messages on the standard error output describing a signal. The \fIsig\fR argument is a signal @@ -30,12 +30,10 @@ been passed as the second argument to an enhanced signal handler. See \fBsigaction\fR(2). The argument string \fIs\fR is printed first, followed by a colon and a blank, followed by the message and a \fBNEWLINE\fR character. .SH USAGE -.sp .LP Messages printed from these functions are in the native language specified by the \fBLC_MESSAGES\fR locale category. See \fBsetlocale\fR(3C). .SH ATTRIBUTES -.sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp @@ -51,7 +49,6 @@ MT-Level Safe .TE .SH SEE ALSO -.sp .LP \fBsigaction\fR(2), \fBgettext\fR(3C), \fBperror\fR(3C), \fBsetlocale\fR(3C), \fBsiginfo.h\fR(3HEAD), \fBsignal.h\fR(3HEAD), \fBattributes\fR(5) -- 2.11.4.GIT