author | Alasdair Lumsden <al@everycity.co.uk> |
Sat, 10 Sep 2011 02:50:50 +0000 | |
branch | oi_151a |
changeset 1430 | 398513b48d4c |
parent 635 | 74823d433dc4 |
permissions | -rw-r--r-- |
0
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
1 |
/* |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
2 |
* CDDL HEADER START |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
3 |
* |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
4 |
* The contents of this file are subject to the terms of the |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
5 |
* Common Development and Distribution License (the "License"). |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
6 |
* You may not use this file except in compliance with the License. |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
7 |
* |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
8 |
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
9 |
* or http://www.opensolaris.org/os/licensing. |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
10 |
* See the License for the specific language governing permissions |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
11 |
* and limitations under the License. |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
12 |
* |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
13 |
* When distributing Covered Code, include this CDDL HEADER in each |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
14 |
* file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
15 |
* If applicable, add the following below this CDDL HEADER, with the |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
16 |
* fields enclosed by brackets "[]" replaced with your own identifying |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
17 |
* information: Portions Copyright [yyyy] [name of copyright owner] |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
18 |
* |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
19 |
* CDDL HEADER END |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
20 |
*/ |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
21 |
/* |
459
56b6b042a167
5653 AI manifest should offer keyword to use max available space for partition/slice
William Schumann <william.schumann@sun.com>
parents:
69
diff
changeset
|
22 |
* Copyright 2009 Sun Microsystems, Inc. All rights reserved. |
0
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
23 |
* Use is subject to license terms. |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
24 |
*/ |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
25 |
|
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
26 |
#include <fcntl.h> |
635
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
27 |
#include <libintl.h> |
0
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
28 |
#include <stdarg.h> |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
29 |
#include <stdio.h> |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
30 |
#include <stdlib.h> |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
31 |
#include <string.h> |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
32 |
#include <sys/param.h> |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
33 |
#include <sys/types.h> |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
34 |
|
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
35 |
#include "orchestrator_private.h" |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
36 |
|
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
37 |
#include <ls_api.h> |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
38 |
|
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
39 |
/* |
635
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
40 |
* array of om_failure_t structures describing all potential failures |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
41 |
* orchestrator can return back to the main install engine |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
42 |
* |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
43 |
* The array element contains following information: |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
44 |
* - error code as defined in orchestrator_api.h |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
45 |
* - string identifying where the failure happened |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
46 |
* - string identifying reason of the failure |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
47 |
* |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
48 |
* Strings can be set to NULL - it indicates that the error code doesn't |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
49 |
* carry this information |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
50 |
* |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
51 |
* The array is not public, since it is assumed to be accessed by means |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
52 |
* of following methods (defined later below): |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
53 |
* om_get_failure_source() |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
54 |
* - returns string describing where the failure happened |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
55 |
* om_get_failure_reason() |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
56 |
* - returns string describing why the failure happened |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
57 |
* |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
58 |
*/ |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
59 |
|
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
60 |
static om_failure_t om_failure_description_array[] = |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
61 |
{ |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
62 |
{ OM_NO_SPACE, |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
63 |
"Orchestrator", |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
64 |
"Ran out of free memory" }, |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
65 |
|
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
66 |
{ OM_NO_INSTALL_TARGET, |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
67 |
"Orchestrator", |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
68 |
"No installation target was specified" }, |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
69 |
|
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
70 |
{ OM_BAD_INSTALL_TARGET, |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
71 |
"Orchestrator", |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
72 |
"Invalid installation target" }, |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
73 |
|
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
74 |
{ OM_NO_PARTITION_FOUND, |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
75 |
"Orchestrator", |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
76 |
"Install failed because there is no Solaris partition.\n" |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
77 |
"To fix the problem, the user can do the following:\n" |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
78 |
" - delete all non-Solaris partitions using the manifest,\n" |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
79 |
" - or create a Solaris partition using the manifest,\n" |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
80 |
" - or create a Solaris partition before running the installer." }, |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
81 |
|
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
82 |
{ OM_ZFS_ROOT_POOL_EXISTS, |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
83 |
"Orchestrator", |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
84 |
"Target disk already contains ZFS root pool 'rpool'" }, |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
85 |
|
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
86 |
{ OM_ERROR_THREAD_CREATE, |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
87 |
"Orchestrator", |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
88 |
"Could not spawn new thread for the installer" }, |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
89 |
|
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
90 |
{ OM_TRANSFER_FAILED, |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
91 |
"Transfer", |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
92 |
"Transferring the files from the source failed." |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
93 |
" Please see previous messages for more details" }, |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
94 |
|
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
95 |
{ OM_TARGET_INSTANTIATION_FAILED, |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
96 |
"Target Instantiation", |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
97 |
"Please see previous messages for more details" }, |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
98 |
|
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
99 |
{ OM_NO_TARGET_ATTRS, |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
100 |
"Orchestrator", |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
101 |
"Mandatory attributes describing the target not provided" }, |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
102 |
|
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
103 |
{ OM_ICT_FAILURE, |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
104 |
"Installation Completion", |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
105 |
"One or more installation completion tasks failed." |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
106 |
" Please see previous messages for more details" } |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
107 |
}; |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
108 |
|
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
109 |
/* |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
110 |
* om_find_failure_in_array |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
111 |
* |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
112 |
* Try to find element in array of failures matching given error code. |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
113 |
* |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
114 |
* Input: error code |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
115 |
* Output: None |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
116 |
* Return: index into array or -1 if element was not found |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
117 |
*/ |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
118 |
|
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
119 |
static int |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
120 |
om_find_failure_in_array(int err_code) |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
121 |
{ |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
122 |
int index; |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
123 |
int total_elem_num = sizeof (om_failure_description_array) / |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
124 |
sizeof (om_failure_description_array[0]); |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
125 |
|
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
126 |
for (index = 0; index < total_elem_num && |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
127 |
om_failure_description_array[index].code != err_code; index++) |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
128 |
; |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
129 |
|
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
130 |
if (index < total_elem_num) |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
131 |
return (index); |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
132 |
else |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
133 |
return (-1); |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
134 |
} |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
135 |
|
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
136 |
|
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
137 |
/* |
0
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
138 |
* Global |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
139 |
*/ |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
140 |
|
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
141 |
/* |
635
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
142 |
* om_is_valid_failure_code |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
143 |
* Check if provided failure code is valid. Valid failure codes have |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
144 |
* their entries in arrays of failures. |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
145 |
* |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
146 |
* Input: error code |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
147 |
* Output: None. |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
148 |
* Return: B_TRUE if failure code is valid, otherwise B_FALSE |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
149 |
*/ |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
150 |
boolean_t |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
151 |
om_is_valid_failure_code(int16_t err_code) |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
152 |
{ |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
153 |
if (om_find_failure_in_array(err_code) != -1) |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
154 |
return (B_TRUE); |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
155 |
else |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
156 |
return (B_FALSE); |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
157 |
} |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
158 |
|
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
159 |
|
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
160 |
/* |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
161 |
* om_get_failure_source |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
162 |
* Determine the source of the failure. |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
163 |
* |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
164 |
* Input: error code |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
165 |
* Output: None. |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
166 |
* Return: string describing where the failure occured or NULL if this |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
167 |
* information can't be determined. |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
168 |
*/ |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
169 |
char * |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
170 |
om_get_failure_source(int16_t err_code) |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
171 |
{ |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
172 |
int index; |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
173 |
|
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
174 |
if ((index = om_find_failure_in_array(err_code)) != -1) |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
175 |
return (gettext(om_failure_description_array[index].source)); |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
176 |
else |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
177 |
return (NULL); |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
178 |
} |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
179 |
|
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
180 |
|
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
181 |
/* |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
182 |
* om_get_failure_reason |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
183 |
* Determine the reason of the failure. |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
184 |
* |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
185 |
* Input: error code |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
186 |
* Output: None. |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
187 |
* Return: string describing why the failure occured or NULL if this |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
188 |
* information can't be determined. |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
189 |
*/ |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
190 |
char * |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
191 |
om_get_failure_reason(int16_t err_code) |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
192 |
{ |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
193 |
int index; |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
194 |
|
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
195 |
if ((index = om_find_failure_in_array(err_code)) != -1) |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
196 |
return (gettext(om_failure_description_array[index].reason)); |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
197 |
else |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
198 |
return (NULL); |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
199 |
} |
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
200 |
|
74823d433dc4
6651 autoinstall needs more useful error messages from Orchestrator module
Jan Damborsky <jan.damborsky@sun.com>
parents:
459
diff
changeset
|
201 |
/* |
0
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
202 |
* om_get_error |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
203 |
* This function returns the current error number set by the last called |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
204 |
* orchestrator function. |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
205 |
* Input: None |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
206 |
* Output: None. |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
207 |
* Return: int16_t - One of the predefined orchestrator errors will |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
208 |
* be returned. If there is are no errors, 0 will be returned |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
209 |
* Each orchestrator function should set the om_errno to 0 |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
210 |
* if there are no errors. |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
211 |
*/ |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
212 |
|
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
213 |
int16_t |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
214 |
om_get_error() |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
215 |
{ |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
216 |
return (om_errno); |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
217 |
} |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
218 |
|
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
219 |
/* |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
220 |
* om_set_error |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
221 |
* This function sets the error number passed as the argument |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
222 |
* Input: int16_t errno _ the error Number that needs to be set |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
223 |
* Output: None. |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
224 |
* Return: None |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
225 |
*/ |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
226 |
void |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
227 |
om_set_error(int16_t errno) |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
228 |
{ |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
229 |
om_errno = errno; |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
230 |
} |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
231 |
|
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
232 |
/* |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
233 |
* om_debug_print() |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
234 |
* Description: Posts debug message |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
235 |
*/ |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
236 |
void |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
237 |
om_debug_print(ls_dbglvl_t dbg_lvl, char *fmt, ...) |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
238 |
{ |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
239 |
va_list ap; |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
240 |
char buf[MAXPATHLEN + 1] = ""; |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
241 |
|
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
242 |
va_start(ap, fmt); |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
243 |
/*LINTED*/ |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
244 |
(void) vsprintf(buf, fmt, ap); |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
245 |
(void) ls_write_dbg_message("OM", dbg_lvl, buf); |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
246 |
va_end(ap); |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
247 |
} |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
248 |
|
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
249 |
/* |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
250 |
* om_log_print() |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
251 |
* Description: Posts log message |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
252 |
*/ |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
253 |
void |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
254 |
om_log_print(char *fmt, ...) |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
255 |
{ |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
256 |
va_list ap; |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
257 |
char buf[MAXPATHLEN + 1] = ""; |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
258 |
|
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
259 |
va_start(ap, fmt); |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
260 |
/*LINTED*/ |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
261 |
(void) vsprintf(buf, fmt, ap); |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
262 |
(void) ls_write_log_message("OM", buf); |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
263 |
va_end(ap); |
87f703f8362e
OpenSolaris files for Slim Install
"mw145384 <moriah.waterland@sun.com>"
parents:
diff
changeset
|
264 |
} |
459
56b6b042a167
5653 AI manifest should offer keyword to use max available space for partition/slice
William Schumann <william.schumann@sun.com>
parents:
69
diff
changeset
|
265 |
|
56b6b042a167
5653 AI manifest should offer keyword to use max available space for partition/slice
William Schumann <william.schumann@sun.com>
parents:
69
diff
changeset
|
266 |
/* |
56b6b042a167
5653 AI manifest should offer keyword to use max available space for partition/slice
William Schumann <william.schumann@sun.com>
parents:
69
diff
changeset
|
267 |
* om_log_std() |
56b6b042a167
5653 AI manifest should offer keyword to use max available space for partition/slice
William Schumann <william.schumann@sun.com>
parents:
69
diff
changeset
|
268 |
* Description: Posts log message, then to stdout and/or stderr |
56b6b042a167
5653 AI manifest should offer keyword to use max available space for partition/slice
William Schumann <william.schumann@sun.com>
parents:
69
diff
changeset
|
269 |
*/ |
56b6b042a167
5653 AI manifest should offer keyword to use max available space for partition/slice
William Schumann <william.schumann@sun.com>
parents:
69
diff
changeset
|
270 |
void |
56b6b042a167
5653 AI manifest should offer keyword to use max available space for partition/slice
William Schumann <william.schumann@sun.com>
parents:
69
diff
changeset
|
271 |
om_log_std(ls_stdouterr_t stdouterr, const char *fmt, ...) |
56b6b042a167
5653 AI manifest should offer keyword to use max available space for partition/slice
William Schumann <william.schumann@sun.com>
parents:
69
diff
changeset
|
272 |
{ |
56b6b042a167
5653 AI manifest should offer keyword to use max available space for partition/slice
William Schumann <william.schumann@sun.com>
parents:
69
diff
changeset
|
273 |
va_list ap; |
56b6b042a167
5653 AI manifest should offer keyword to use max available space for partition/slice
William Schumann <william.schumann@sun.com>
parents:
69
diff
changeset
|
274 |
char buf[MAXPATHLEN] = ""; |
56b6b042a167
5653 AI manifest should offer keyword to use max available space for partition/slice
William Schumann <william.schumann@sun.com>
parents:
69
diff
changeset
|
275 |
|
56b6b042a167
5653 AI manifest should offer keyword to use max available space for partition/slice
William Schumann <william.schumann@sun.com>
parents:
69
diff
changeset
|
276 |
va_start(ap, fmt); |
56b6b042a167
5653 AI manifest should offer keyword to use max available space for partition/slice
William Schumann <william.schumann@sun.com>
parents:
69
diff
changeset
|
277 |
/*LINTED*/ |
56b6b042a167
5653 AI manifest should offer keyword to use max available space for partition/slice
William Schumann <william.schumann@sun.com>
parents:
69
diff
changeset
|
278 |
(void) vsprintf(buf, fmt, ap); |
56b6b042a167
5653 AI manifest should offer keyword to use max available space for partition/slice
William Schumann <william.schumann@sun.com>
parents:
69
diff
changeset
|
279 |
(void) ls_log_std(stdouterr, "OM", buf); |
56b6b042a167
5653 AI manifest should offer keyword to use max available space for partition/slice
William Schumann <william.schumann@sun.com>
parents:
69
diff
changeset
|
280 |
va_end(ap); |
56b6b042a167
5653 AI manifest should offer keyword to use max available space for partition/slice
William Schumann <william.schumann@sun.com>
parents:
69
diff
changeset
|
281 |
} |