util.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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
* 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]
*
* CDDL HEADER END
*/
/*
* Copyright 2002-2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdlib.h>
#include <strings.h>
#include <errno.h>
#include <pthread.h>
#include "util.h"
int *);
static void cleanupThreadExceptions(void *pParam);
#pragma fini(errorFinalize)
/*
* The infastructure will call this when
* an error occurs, it should return a
* CCIMException which describes the error.
* Caller is responsable for freeing
* memory assocaited with the returned CCIMException
*/
{
return (lastError);
}
/*
* Handle the errors that come in from the providers. This involves writing to
* the CIM log and setting the last error on the stack for the CIMOM exception
* handling.
*/
void
{
/*
* Create a copy of the exception, if it exists. The caller of
* this function should free the exception passed in.
*/
if (reasonString == NULL) {
} else {
}
} else {
}
}
void *
*error = 0;
do {
break;
}
} while (pList);
return ((CCIMProperty *)NULL);
}
/*
* If reference property, then return object path. In all other cases.
* the value is a string.
*/
return (pProp->mObjPathValue);
} else {
}
}
void
{
*error = 0;
*error = CIM_ERR_FAILED;
return;
}
*error = CIM_ERR_FAILED;
return;
}
}
void
{
*error = 0;
return;
}
*error = CIM_ERR_FAILED;
return;
}
}
/*
* Function: openFile
*
* Parameters: fileName - char pointer to the name of the file to open.
* fMode - char pointer to the mode used to open the file.
*
* Returns: On successful completion returns the FILE pointer for
* the open file.
* On failure returns a NULL FILE pointer.
*
* Description: 'fopen's file and checks for errors.
*/
FILE *
{
int error;
/* Open the temporary file based on fMode */
}
return (pTmpFile);
}
/*
* Function: util_closeFile
*
* Parameters: file - FILE pointer to an open file.
*
* Returns: On successful completion returns 1.
* On failure returns 0.
*
* Description: 'fclose's file and handles errors.
*/
/* ARGSUSED */
int
{
int error;
return (0);
}
return (1);
}
/*
* Function: util_removeFile
*
* Parameters: tFName - char pointer to the filename
*
* Returns: NULL
*
* Description: Removes file and releases the memory used for
* the filename.
*/
void
util_removeFile(char *tFName)
{
int error;
}
}
char *
{
static char msgBuf[MAXFAILSTRINGLEN];
/*
* TRANSLATION_NOTE
*
* "%s Failed." indicates an error returned by the function
* whose name is specified by the string used to replace %s.
*/
return (msgBuf);
}
/*
* Function: util_routineStartDaemonMessage
*
* Parameters: dname - the name of the daemon we we're attempting to start
*
* Returns: the generated string
*
* Description: creates a localized sring for eror messages.
*/
char *
{
static char msgBuf[MAXFAILSTRINGLEN];
/*
* TRANSLATION_NOTE
*
* "%s failed to start and must be started manually. " indicates
* an error stsrting the daemon specified by the string used to
* replace %s.
*/
"%s failed to start and must be started manually. "),
dname);
return (msgBuf);
}
static void
cleanupThreadExceptions(void *pParam)
{
CCIMException *e = pParam;
}
static void errorInit()
{
/* Create the TSD key */
(void) pthread_key_create(&gWbemDiskLastErrorKey,
hostName[0] = '\0';
}
}
static void
{
(void) pthread_key_delete(gWbemDiskLastErrorKey);
}
static void
{
char *msgp = "(null)";
}
if (pErrString != NULL) {
msgp = (char *)pErrString;
}
*errp = 1;
}