message.c (7c478bd9) message.c (5aefb655)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22/*
23 * Copyright(c) 1988 AT&T
24 * All Rights Reserved
25 *
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright(c) 1988 AT&T
23 * All Rights Reserved
24 *
26 *
27 * Copyright(c) 1995 by Sun Microsystems, Inc.
28 * All Rights Reserved
25 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
29 */
30#pragma ident "%Z%%M% %I% %E% SMI"
31#include "mcs.h"
32
33static const char *msg[] = {
34/* MALLOC_ERROR */
35"%s: malloc memory allocation failure.\n",
36/* USAGE_ERROR */

--- 69 unchanged lines hidden (view full) ---

106 sys_mes = va_arg(ap, char *);
107
108 switch (mes) {
109 case MALLOC_ERROR:
110 case USAGE_ERROR:
111 case ELFVER_ERROR:
112 case EXEC_AR_ERROR:
113 case LIBELF_ERROR:
27 */
28#pragma ident "%Z%%M% %I% %E% SMI"
29#include "mcs.h"
30
31static const char *msg[] = {
32/* MALLOC_ERROR */
33"%s: malloc memory allocation failure.\n",
34/* USAGE_ERROR */

--- 69 unchanged lines hidden (view full) ---

104 sys_mes = va_arg(ap, char *);
105
106 switch (mes) {
107 case MALLOC_ERROR:
108 case USAGE_ERROR:
109 case ELFVER_ERROR:
110 case EXEC_AR_ERROR:
111 case LIBELF_ERROR:
112 /* LINTED */
114 (void) fprintf(stderr, message, va_arg(ap, char *));
115 break;
116 case OPEN_ERROR:
117 case ACCESS_ERROR:
118 case OPEN_TEMP_ERROR:
119 case FILE_TYPE_ERROR:
120 case NOT_MANIPULATED_ERROR:
121 case WRN_MANIPULATED_ERROR:

--- 11 unchanged lines hidden (view full) ---

133 case WRITE_MANI_ERROR:
134 case LSEEK_MANI_ERROR:
135 case ACT_PRINT_ERROR:
136 case ACT_DELETE1_ERROR:
137 case ACT_APPEND1_ERROR:
138 case ACT_APPEND2_ERROR:
139 case ACT_COMPRESS1_ERROR:
140 case ACT_COMPRESS2_ERROR: {
113 (void) fprintf(stderr, message, va_arg(ap, char *));
114 break;
115 case OPEN_ERROR:
116 case ACCESS_ERROR:
117 case OPEN_TEMP_ERROR:
118 case FILE_TYPE_ERROR:
119 case NOT_MANIPULATED_ERROR:
120 case WRN_MANIPULATED_ERROR:

--- 11 unchanged lines hidden (view full) ---

132 case WRITE_MANI_ERROR:
133 case LSEEK_MANI_ERROR:
134 case ACT_PRINT_ERROR:
135 case ACT_DELETE1_ERROR:
136 case ACT_APPEND1_ERROR:
137 case ACT_APPEND2_ERROR:
138 case ACT_COMPRESS1_ERROR:
139 case ACT_COMPRESS2_ERROR: {
141 char * a = va_arg(ap, char *);
142 char * b = va_arg(ap, char *);
143 char * c = va_arg(ap, char *);
140 char *a = va_arg(ap, char *);
141 char *b = va_arg(ap, char *);
142 char *c = va_arg(ap, char *);
143 /* LINTED */
144 (void) fprintf(stderr, message, a, b, c);
145 break;
146 }
147 case ACT_DELETE2_ERROR: {
144 (void) fprintf(stderr, message, a, b, c);
145 break;
146 }
147 case ACT_DELETE2_ERROR: {
148 char * a = va_arg(ap, char *);
149 char * b = va_arg(ap, char *);
150 char * c = va_arg(ap, char *);
151 char * d = va_arg(ap, char *);
148 char *a = va_arg(ap, char *);
149 char *b = va_arg(ap, char *);
150 char *c = va_arg(ap, char *);
151 char *d = va_arg(ap, char *);
152 /* LINTED */
152 (void) fprintf(stderr, message, a, b, c, d);
153 break;
154 }
155 case GETARHDR_ERROR: {
153 (void) fprintf(stderr, message, a, b, c, d);
154 break;
155 }
156 case GETARHDR_ERROR: {
156 char * a = va_arg(ap, char *);
157 char * b = va_arg(ap, char *);
157 char *a = va_arg(ap, char *);
158 char *b = va_arg(ap, char *);
158 long c = va_arg(ap, long);
159 long c = va_arg(ap, long);
160 /* LINTED */
159 (void) fprintf(stderr, message, a, b, c);
160 break;
161 }
162 default:
163 (void) fprintf(stderr, "internal error: error_message(%d)\n",
164 mes);
165 exit(100);
166 }
167
168 if (flag != PLAIN_ERROR)
169 (void) fprintf(stderr, "\t%s\n", sys_mes);
170 va_end(ap);
171}
161 (void) fprintf(stderr, message, a, b, c);
162 break;
163 }
164 default:
165 (void) fprintf(stderr, "internal error: error_message(%d)\n",
166 mes);
167 exit(100);
168 }
169
170 if (flag != PLAIN_ERROR)
171 (void) fprintf(stderr, "\t%s\n", sys_mes);
172 va_end(ap);
173}