* directory or online at http://www.openafs.org/dl/license10.html
*/
-#include <stdio.h>
+#include <afsconfig.h>
+#include <afs/param.h>
#include <afs/stds.h>
-#include "afs_bosAdmin.h"
-#include "../adminutil/afs_AdminInternal.h"
+
+#include <roken.h>
+
+#include <rx/rx.h>
+#include <rx/rxstat.h>
#include <afs/afs_AdminErrors.h>
#include <afs/afs_utilAdmin.h>
#include <afs/bosint.h>
#include <afs/bnode.h>
#include <afs/ktime.h>
#include <afs/dirpath.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#ifdef AFS_NT40_ENV
-#include <io.h>
-#endif
-#include "../../permit_xprt.h"
-
-/*
- * Prototypes for functions that don't exist in any header files
- */
-
-extern int BOZO_AddCellHost();
-extern int BOZO_AddKey();
-extern int BOZO_AddSUser();
-extern int BOZO_CreateBnode();
-extern int BOZO_DeleteBnode();
-extern int BOZO_DeleteCellHost();
-extern int BOZO_DeleteKey();
-extern int BOZO_DeleteSUser();
-extern int BOZO_EnumerateInstance();
-extern int BOZO_Exec();
-extern int BOZO_GetCellHost();
-extern int BOZO_GetCellName();
-extern int BOZO_GetDates();
-extern int BOZO_GetInstanceInfo();
-extern int BOZO_GetInstanceParm();
-extern int BOZO_GetInstanceParm();
-extern int BOZO_GetRestartTime();
-extern int BOZO_GetStatus();
-extern int BOZO_ListSUsers();
-extern int BOZO_ListKeys();
-extern int BOZO_Prune();
-extern int BOZO_ReBozo();
-extern int BOZO_Restart();
-extern int BOZO_RestartAll();
-extern int BOZO_SetCellName();
-extern int BOZO_SetNoAuthFlag();
-extern int BOZO_SetRestartTime();
-extern int BOZO_SetStatus(struct rx_connection *, const char *, long);
-extern int BOZO_SetTStatus(struct rx_connection *, const char *, long);
-extern int BOZO_ShutdownAll();
-extern int BOZO_StartupAll();
-extern int BOZO_UnInstall();
-extern int BOZO_WaitAll();
-extern int StartBOZO_GetLog();
-extern int StartBOZO_Install();
+#include "afs_bosAdmin.h"
+#include "../adminutil/afs_AdminInternal.h"
typedef struct bos_server {
int begin_magic;
* Returns != 0 upon successful completion.
*/
-int isValidServerHandle (
- const bos_server_p serverHandle,
- afs_status_p st)
+int
+isValidServerHandle(const bos_server_p serverHandle, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
if (serverHandle == NULL) {
- tst = ADMBOSSERVERHANDLENULL;
- goto fail_IsValidServerHandle;
+ tst = ADMBOSSERVERHANDLENULL;
+ goto fail_IsValidServerHandle;
}
- if ((serverHandle->begin_magic != BEGIN_MAGIC) ||
- (serverHandle->end_magic != END_MAGIC)) {
- tst = ADMBOSSERVERHANDLEBADMAGIC;
- goto fail_IsValidServerHandle;
+ if ((serverHandle->begin_magic != BEGIN_MAGIC)
+ || (serverHandle->end_magic != END_MAGIC)) {
+ tst = ADMBOSSERVERHANDLEBADMAGIC;
+ goto fail_IsValidServerHandle;
}
if (serverHandle->is_valid == 0) {
- tst = ADMBOSSERVERHANDLEINVALID;
- goto fail_IsValidServerHandle;
+ tst = ADMBOSSERVERHANDLEINVALID;
+ goto fail_IsValidServerHandle;
}
if (serverHandle->server == NULL) {
- tst = ADMBOSSERVERHANDLENOSERVER;
- goto fail_IsValidServerHandle;
+ tst = ADMBOSSERVERHANDLENOSERVER;
+ goto fail_IsValidServerHandle;
}
if (serverHandle->server_encrypt == NULL) {
- tst = ADMBOSSERVERHANDLENOSERVER;
- goto fail_IsValidServerHandle;
+ tst = ADMBOSSERVERHANDLENOSERVER;
+ goto fail_IsValidServerHandle;
}
rc = 1;
-fail_IsValidServerHandle:
-
+ fail_IsValidServerHandle:
+
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
+
/*
* IsValidCellHandle - verify that a cell handle can be used to make bos
* requests.
*
* Returns != 0 upon successful completion.
*/
-
-static int IsValidCellHandle(
- afs_cell_handle_p cellHandle,
- afs_status_p st)
+
+static int
+IsValidCellHandle(afs_cell_handle_p cellHandle, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
-
- if (!CellHandleIsValid((void *) cellHandle, &tst)) {
- goto fail_IsValidCellHandle;
+
+ if (!CellHandleIsValid((void *)cellHandle, &tst)) {
+ goto fail_IsValidCellHandle;
}
-
+
if (cellHandle->tokens == NULL) {
- tst = ADMBOSCELLHANDLENOTOKENS;
- goto fail_IsValidCellHandle;
+ tst = ADMBOSCELLHANDLENOTOKENS;
+ goto fail_IsValidCellHandle;
}
rc = 1;
-
-fail_IsValidCellHandle:
-
+
+ fail_IsValidCellHandle:
+
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
-
+
/*
* bos_ServerOpen - open a bos server for work.
*
* Returns != 0 upon successful completion.
*/
-int ADMINAPI bos_ServerOpen(
- const void *cellHandle,
- const char *serverName,
- void **serverHandleP,
- afs_status_p st)
+int ADMINAPI
+bos_ServerOpen(const void *cellHandle, const char *serverName,
+ void **serverHandleP, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
- bos_server_p bos_server = (bos_server_p) malloc(sizeof(bos_server_t));
+ bos_server_p bos_server = calloc(1, sizeof(bos_server_t));
int serverAddress;
-
+
/*
* Validate parameters
*/
goto fail_bos_ServerOpen;
}
- if (util_AdminServerAddressGetFromName(serverName, &serverAddress, &tst) == 0) {
+ if (util_AdminServerAddressGetFromName(serverName, &serverAddress, &tst)
+ == 0) {
goto fail_bos_ServerOpen;
}
goto fail_bos_ServerOpen;
}
- bos_server->server = rx_GetCachedConnection(htonl(serverAddress),
- htons(AFSCONF_NANNYPORT), 1,
- c_handle->tokens->afs_sc[c_handle->tokens->sc_index], c_handle->tokens->sc_index);
-
- bos_server->server_encrypt = rx_GetCachedConnection(htonl(serverAddress),
- htons(AFSCONF_NANNYPORT), 1,
- c_handle->tokens->afs_encrypt_sc[c_handle->tokens->sc_index], c_handle->tokens->sc_index);
-
- bos_server->server_stats = rx_GetCachedConnection(htonl(serverAddress),
- htons(AFSCONF_NANNYPORT),
- RX_STATS_SERVICE_ID,
- c_handle->tokens->afs_sc[c_handle->tokens->sc_index], c_handle->tokens->sc_index);
+ bos_server->server =
+ rx_GetCachedConnection(htonl(serverAddress), htons(AFSCONF_NANNYPORT),
+ 1,
+ c_handle->tokens->afs_sc[c_handle->tokens->
+ sc_index],
+ c_handle->tokens->sc_index);
+
+ bos_server->server_encrypt =
+ rx_GetCachedConnection(htonl(serverAddress), htons(AFSCONF_NANNYPORT),
+ 1,
+ c_handle->tokens->afs_encrypt_sc[c_handle->
+ tokens->
+ sc_index],
+ c_handle->tokens->sc_index);
+
+ bos_server->server_stats =
+ rx_GetCachedConnection(htonl(serverAddress), htons(AFSCONF_NANNYPORT),
+ RX_STATS_SERVICE_ID,
+ c_handle->tokens->afs_sc[c_handle->tokens->
+ sc_index],
+ c_handle->tokens->sc_index);
if ((bos_server->server == NULL) || (bos_server->server_encrypt == NULL)) {
tst = ADMBOSSERVERNOCONNECTION;
bos_server->is_valid = 1;
bos_server->end_magic = END_MAGIC;
- *serverHandleP = (void *) bos_server;
+ *serverHandleP = (void *)bos_server;
rc = 1;
-fail_bos_ServerOpen:
+ fail_bos_ServerOpen:
if ((rc == 0) && (bos_server != NULL)) {
if (bos_server->server) {
}
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
* Returns != 0 upon successful completion.
*/
-int ADMINAPI bos_ServerClose(
- const void *serverHandle,
- afs_status_p st)
+int ADMINAPI
+bos_ServerClose(const void *serverHandle, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
-
+
if (isValidServerHandle(b_handle, &tst)) {
rx_ReleaseCachedConnection(b_handle->server);
b_handle->is_valid = 0;
}
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
* CAUTION - this list must match bos_ProcessType_t definition
*/
-static char *processTypes[] = {"simple", "fs", "cron", 0};
+static char *processTypes[] = { "simple", "fs", "cron", 0 };
-int ADMINAPI bos_ProcessCreate(
- const void *serverHandle,
- const char *processName,
- bos_ProcessType_t processType,
- const char *process,
- const char *cronTime,
- const char *notifier,
- afs_status_p st)
+int ADMINAPI
+bos_ProcessCreate(const void *serverHandle, char *processName,
+ bos_ProcessType_t processType, char *process,
+ char *cronTime, char *notifier, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_ProcessCreate;
}
goto fail_bos_ProcessCreate;
}
- tst = BOZO_CreateBnode(b_handle->server, processTypes[processType],
- processName, process,
- (cronTime) ? cronTime : "", "", "", "",
- (notifier) ? notifier : NONOTIFIER);
+ tst =
+ BOZO_CreateBnode(b_handle->server, processTypes[processType],
+ processName, process, (cronTime) ? cronTime : "", "",
+ "", "", (notifier) ? notifier : NONOTIFIER);
if (tst == 0) {
rc = 1;
}
-fail_bos_ProcessCreate:
+ fail_bos_ProcessCreate:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
* Returns != 0 upon successful completion.
*/
-int ADMINAPI bos_FSProcessCreate(
- const void *serverHandle,
- const char *processName,
- const char *fileserverPath,
- const char *volserverPath,
- const char *salvagerPath,
- const char *notifier,
- afs_status_p st)
+int ADMINAPI
+bos_FSProcessCreate(const void *serverHandle, char *processName,
+ char *fileserverPath, char *volserverPath,
+ char *salvagerPath, char *notifier,
+ afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_ProcessCreate;
}
goto fail_bos_ProcessCreate;
}
- tst = BOZO_CreateBnode(b_handle->server,
- processTypes[BOS_PROCESS_FS],
- processName,
- fileserverPath,
- volserverPath,
- salvagerPath,
- "",
- "",
- (notifier) ? notifier : NONOTIFIER);
+ tst =
+ BOZO_CreateBnode(b_handle->server, processTypes[BOS_PROCESS_FS],
+ processName, fileserverPath, volserverPath,
+ salvagerPath, "", "",
+ (notifier) ? notifier : NONOTIFIER);
if (tst == 0) {
rc = 1;
}
-fail_bos_ProcessCreate:
+ fail_bos_ProcessCreate:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
* Returns != 0 upon successful completion.
*/
-int ADMINAPI bos_ProcessDelete(
- const void *serverHandle,
- const char *processName,
- afs_status_p st)
+int ADMINAPI
+bos_ProcessDelete(const void *serverHandle, char *processName,
+ afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_ProcessDelete;
}
rc = 1;
}
-fail_bos_ProcessDelete:
+ fail_bos_ProcessDelete:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
* Returns != 0 upon successful completion.
*/
-int ADMINAPI bos_ProcessExecutionStateGet(
- const void *serverHandle,
- const char *processName,
- bos_ProcessExecutionState_p processStatusP,
- char *auxiliaryProcessStatus,
- afs_status_p st)
+int ADMINAPI
+bos_ProcessExecutionStateGet(const void *serverHandle,
+ char *processName,
+ bos_ProcessExecutionState_p processStatusP,
+ char *auxiliaryProcessStatus, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
afs_int32 state;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_ProcessExecutionStateGet;
}
goto fail_bos_ProcessExecutionStateGet;
}
- tst = BOZO_GetStatus(b_handle->server, processName, &state, &auxiliaryProcessStatus);
+ tst =
+ BOZO_GetStatus(b_handle->server, processName, &state,
+ &auxiliaryProcessStatus);
if (tst != 0) {
goto fail_bos_ProcessExecutionStateGet;
*processStatusP = (bos_ProcessExecutionState_t) state;
rc = 1;
-fail_bos_ProcessExecutionStateGet:
+ fail_bos_ProcessExecutionStateGet:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
* Returns != 0 upon successful completion.
*/
-static int SetExecutionState(
- const void *serverHandle,
- const char *processName,
- const bos_ProcessExecutionState_t processStatus,
- int (*func)(struct rx_connection *, const char *, afs_int32),
- afs_status_p st)
+static int
+SetExecutionState(const void *serverHandle, const char *processName,
+ const bos_ProcessExecutionState_t processStatus,
+ int (*func) (struct rx_connection *, const char *,
+ afs_int32), afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
afs_int32 state;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_SetExecutionState;
}
goto fail_SetExecutionState;
}
- if ((processStatus != BOS_PROCESS_STOPPED) &&
- (processStatus != BOS_PROCESS_RUNNING)) {
+ if ((processStatus != BOS_PROCESS_STOPPED)
+ && (processStatus != BOS_PROCESS_RUNNING)) {
tst = ADMBOSPROCESSSTATUSSET;
goto fail_SetExecutionState;
}
state = (afs_int32) processStatus;
- tst = func(b_handle->server, processName, state);
+ tst = func(b_handle->server, (char *)processName, state);
if (tst == 0) {
rc = 1;
}
-fail_SetExecutionState:
+ fail_SetExecutionState:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
* Returns != 0 upon successful completion.
*/
-int ADMINAPI bos_ProcessExecutionStateSet(
- const void *serverHandle,
- const char *processName,
- bos_ProcessExecutionState_t processStatus,
- afs_status_p st)
+int ADMINAPI
+bos_ProcessExecutionStateSet(const void *serverHandle,
+ const char *processName,
+ const bos_ProcessExecutionState_t processStatus,
+ afs_status_p st)
{
return SetExecutionState(serverHandle, processName, processStatus,
BOZO_SetStatus, st);
* Returns != 0 upon successful completion.
*/
-int ADMINAPI bos_ProcessExecutionStateSetTemporary(
- const void *serverHandle,
- const char *processName,
- bos_ProcessExecutionState_t processStatus,
- afs_status_p st)
+int ADMINAPI
+bos_ProcessExecutionStateSetTemporary(const void *serverHandle,
+ char *processName,
+ bos_ProcessExecutionState_t
+ processStatus, afs_status_p st)
{
return SetExecutionState(serverHandle, processName, processStatus,
BOZO_SetTStatus, st);
*/
typedef struct process_name_get {
- int next;
- struct rx_connection *server;
- char process[CACHED_ITEMS][BOS_MAX_NAME_LEN];
+ int next;
+ struct rx_connection *server;
+ char process[CACHED_ITEMS][BOS_MAX_NAME_LEN];
} process_name_get_t, *process_name_get_p;
-static int GetProcessNameRPC(
- void *rpc_specific,
- int slot,
- int *last_item,
- int *last_item_contains_data,
- afs_status_p st)
+static int
+GetProcessNameRPC(void *rpc_specific, int slot, int *last_item,
+ int *last_item_contains_data, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
process_name_get_p proc = (process_name_get_p) rpc_specific;
- char *ptr = (char *) &proc->process[slot];
+ char *ptr = (char *)&proc->process[slot];
tst = BOZO_EnumerateInstance(proc->server, proc->next++, &ptr);
return rc;
}
-static int GetProcessNameFromCache(
- void *rpc_specific,
- int slot,
- void *dest,
- afs_status_p st)
+static int
+GetProcessNameFromCache(void *rpc_specific, int slot, void *dest,
+ afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
process_name_get_p proc = (process_name_get_p) rpc_specific;
- strcpy((char *) dest, (char *) &proc->process[slot]);
+ strcpy((char *)dest, (char *)&proc->process[slot]);
rc = 1;
if (st != NULL) {
}
return rc;
}
-
+
/*
* bos_ProcessNameGetBegin - begin iterating over the list of processes
* at a particular bos server.
*
*/
-int ADMINAPI bos_ProcessNameGetBegin(
- const void *serverHandle,
- void **iterationIdP,
- afs_status_p st)
+int ADMINAPI
+bos_ProcessNameGetBegin(const void *serverHandle, void **iterationIdP,
+ afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
- afs_admin_iterator_p iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
- process_name_get_p proc = (process_name_get_p) malloc(sizeof(process_name_get_t));
-
+ afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
+ process_name_get_p proc = malloc(sizeof(process_name_get_t));
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_ProcessNameGetBegin;
}
proc->next = 0;
proc->server = b_handle->server;
- if (IteratorInit(iter, (void *) proc, GetProcessNameRPC, GetProcessNameFromCache, NULL, NULL, &tst)) {
- *iterationIdP = (void *) iter;
+ if (IteratorInit
+ (iter, (void *)proc, GetProcessNameRPC, GetProcessNameFromCache, NULL,
+ NULL, &tst)) {
+ *iterationIdP = (void *)iter;
} else {
goto fail_bos_ProcessNameGetBegin;
}
rc = 1;
-fail_bos_ProcessNameGetBegin:
+ fail_bos_ProcessNameGetBegin:
if (rc == 0) {
if (iter != NULL) {
}
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
-
+
/*
* bos_ProcessNameGetNext - retrieve the next process name from the bos server.
*
*
*/
-int ADMINAPI bos_ProcessNameGetNext(
- const void *iterationId,
- char *processName,
- afs_status_p st)
+int ADMINAPI
+bos_ProcessNameGetNext(const void *iterationId, char *processName,
+ afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
-
+
if (processName == NULL) {
tst = ADMBOSPROCESSNAMENULL;
goto fail_bos_ProcessNameGetNext;
goto fail_bos_ProcessNameGetNext;
}
- rc = IteratorNext(iter, (void *) processName, &tst);
+ rc = IteratorNext(iter, (void *)processName, &tst);
-fail_bos_ProcessNameGetNext:
+ fail_bos_ProcessNameGetNext:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_ProcessNameGetDone(
- const void *iterationId,
- afs_status_p st)
+int ADMINAPI
+bos_ProcessNameGetDone(const void *iterationId, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
-
+
if (iterationId == NULL) {
tst = ADMITERATIONIDPNULL;
goto fail_bos_ProcessNameGetDone;
rc = IteratorDone(iter, &tst);
-fail_bos_ProcessNameGetDone:
+ fail_bos_ProcessNameGetDone:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_ProcessInfoGet(
- const void *serverHandle,
- const char *processName,
- bos_ProcessType_p processTypeP,
- bos_ProcessInfo_p processInfoP,
- afs_status_p st)
+int ADMINAPI
+bos_ProcessInfoGet(const void *serverHandle, char *processName,
+ bos_ProcessType_p processTypeP,
+ bos_ProcessInfo_p processInfoP, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
char *ptr = type;
struct bozo_status status;
int i;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_ProcessInfoGet;
}
}
- for(i=0;(processTypes[i] != NULL); i++) {
+ for (i = 0; (processTypes[i] != NULL); i++) {
if (!strcmp(processTypes[i], type)) {
*processTypeP = (bos_ProcessType_t) i;
break;
}
rc = 1;
-fail_bos_ProcessInfoGet:
+ fail_bos_ProcessInfoGet:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*/
typedef struct param_get {
- int next;
- struct rx_connection *server;
- char processName[BOS_MAX_NAME_LEN];
- char param[CACHED_ITEMS][BOS_MAX_NAME_LEN];
+ int next;
+ struct rx_connection *server;
+ char processName[BOS_MAX_NAME_LEN];
+ char param[CACHED_ITEMS][BOS_MAX_NAME_LEN];
} param_get_t, *param_get_p;
-static int GetParameterRPC(
- void *rpc_specific,
- int slot,
- int *last_item,
- int *last_item_contains_data,
- afs_status_p st)
+static int
+GetParameterRPC(void *rpc_specific, int slot, int *last_item,
+ int *last_item_contains_data, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
param_get_p param = (param_get_p) rpc_specific;
- char *ptr = (char *) ¶m->param[slot];
+ char *ptr = (char *)¶m->param[slot];
- tst = BOZO_GetInstanceParm(param->server, param->processName,
- param->next++, &ptr);
+ tst =
+ BOZO_GetInstanceParm(param->server, param->processName, param->next++,
+ &ptr);
if (tst == 0) {
rc = 1;
return rc;
}
-static int GetParameterFromCache(
- void *rpc_specific,
- int slot,
- void *dest,
- afs_status_p st)
+static int
+GetParameterFromCache(void *rpc_specific, int slot, void *dest,
+ afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
param_get_p param = (param_get_p) rpc_specific;
- strcpy((char *) dest, (char *) ¶m->param[slot]);
+ strcpy((char *)dest, (char *)¶m->param[slot]);
rc = 1;
if (st != NULL) {
}
return rc;
}
-
+
/*
* bos_ProcessParameterGetBegin - begin iterating over the parameters
* of a particular process.
*
*/
-int ADMINAPI bos_ProcessParameterGetBegin(
- const void *serverHandle,
- const char *processName,
- void **iterationIdP,
- afs_status_p st)
+int ADMINAPI
+bos_ProcessParameterGetBegin(const void *serverHandle,
+ const char *processName, void **iterationIdP,
+ afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
- afs_admin_iterator_p iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
- param_get_p param = (param_get_p) malloc(sizeof(param_get_t));
-
+ afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
+ param_get_p param = malloc(sizeof(param_get_t));
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_ProcessParameterGetBegin;
}
param->server = b_handle->server;
strcpy(param->processName, processName);
- if (IteratorInit(iter, (void *) param, GetParameterRPC,
- GetParameterFromCache, NULL, NULL, &tst)) {
- *iterationIdP = (void *) iter;
+ if (IteratorInit
+ (iter, (void *)param, GetParameterRPC, GetParameterFromCache, NULL,
+ NULL, &tst)) {
+ *iterationIdP = (void *)iter;
} else {
goto fail_bos_ProcessParameterGetBegin;
}
rc = 1;
-fail_bos_ProcessParameterGetBegin:
+ fail_bos_ProcessParameterGetBegin:
if (rc == 0) {
if (iter != NULL) {
}
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
* Returns != 0 upon successful completion.
*
*/
-
-int ADMINAPI bos_ProcessParameterGetNext(
- const void *iterationId,
- char *parameter,
- afs_status_p st)
+
+int ADMINAPI
+bos_ProcessParameterGetNext(const void *iterationId, char *parameter,
+ afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
-
+
if (iterationId == NULL) {
tst = ADMITERATIONIDPNULL;
goto fail_bos_ProcessParameterGetNext;
}
-
+
if (parameter == NULL) {
tst = ADMBOSPARAMETERNULL;
goto fail_bos_ProcessParameterGetNext;
}
- rc = IteratorNext(iter, (void *) parameter, &tst);
+ rc = IteratorNext(iter, (void *)parameter, &tst);
-fail_bos_ProcessParameterGetNext:
+ fail_bos_ProcessParameterGetNext:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_ProcessParameterGetDone(
- const void *iterationId,
- afs_status_p st)
+int ADMINAPI
+bos_ProcessParameterGetDone(const void *iterationId, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
-
+
if (iterationId == NULL) {
tst = ADMITERATIONIDPNULL;
goto fail_bos_ProcessParameterGetDone;
rc = IteratorDone(iter, &tst);
-fail_bos_ProcessParameterGetDone:
+ fail_bos_ProcessParameterGetDone:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_ProcessNotifierGet(
- const void *serverHandle,
- const char *processName,
- char *notifier,
- afs_status_p st)
+int ADMINAPI
+bos_ProcessNotifierGet(const void *serverHandle, const char *processName,
+ char *notifier, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_ProcessNotifierGet;
}
tst = ADMBOSPROCESSNAMENULL;
goto fail_bos_ProcessNotifierGet;
}
-
+
if (notifier == NULL) {
tst = ADMBOSNOTIFIERNULL;
goto fail_bos_ProcessNotifierGet;
}
- tst = BOZO_GetInstanceParm(b_handle->server, processName, 999, ¬ifier);
+ tst = BOZO_GetInstanceParm(b_handle->server, (char *)processName,
+ 999, ¬ifier);
if (tst == 0) {
rc = 1;
}
-fail_bos_ProcessNotifierGet:
+ fail_bos_ProcessNotifierGet:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_ProcessRestart(
- const void *serverHandle,
- const char *processName,
- afs_status_p st)
+int ADMINAPI
+bos_ProcessRestart(const void *serverHandle, const char *processName,
+ afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_ProcessRestart;
}
goto fail_bos_ProcessRestart;
}
- tst = BOZO_Restart(b_handle->server, processName);
+ tst = BOZO_Restart(b_handle->server, (char *)processName);
if (tst == 0) {
rc = 1;
}
-fail_bos_ProcessRestart:
+ fail_bos_ProcessRestart:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_ProcessAllStop(
- const void *serverHandle,
- afs_status_p st)
+int ADMINAPI
+bos_ProcessAllStop(const void *serverHandle, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_ProcessAllStop;
}
-
+
tst = BOZO_ShutdownAll(b_handle->server);
if (tst == 0) {
rc = 1;
}
-fail_bos_ProcessAllStop:
+ fail_bos_ProcessAllStop:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_ProcessAllStart(
- const void *serverHandle,
- afs_status_p st)
+int ADMINAPI
+bos_ProcessAllStart(const void *serverHandle, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_ProcessAllStart;
}
-
+
tst = BOZO_StartupAll(b_handle->server);
if (tst == 0) {
rc = 1;
}
-fail_bos_ProcessAllStart:
+ fail_bos_ProcessAllStart:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_ProcessAllWaitStop(
- const void *serverHandle,
- afs_status_p st)
+int ADMINAPI
+bos_ProcessAllWaitStop(const void *serverHandle, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_ProcessAllWaitStop;
}
-
+
if (!bos_ProcessAllStop(serverHandle, &tst)) {
goto fail_bos_ProcessAllWaitStop;
}
rc = 1;
}
-fail_bos_ProcessAllWaitStop:
+ fail_bos_ProcessAllWaitStop:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_ProcessAllWaitTransition(
- const void *serverHandle,
- afs_status_p st)
+int ADMINAPI
+bos_ProcessAllWaitTransition(const void *serverHandle, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_ProcessAllWaitTransition;
}
-
+
tst = BOZO_WaitAll(b_handle->server);
if (tst == 0) {
rc = 1;
}
-fail_bos_ProcessAllWaitTransition:
+ fail_bos_ProcessAllWaitTransition:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_ProcessAllStopAndRestart(
- const void *serverHandle,
- bos_RestartBosServer_t restartBosServer,
- afs_status_p st)
+int ADMINAPI
+bos_ProcessAllStopAndRestart(const void *serverHandle,
+ bos_RestartBosServer_t restartBosServer,
+ afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_ProcessAllStopAndRestart;
}
}
tst = BOZO_RestartAll(b_handle->server);
-
+
if (tst == 0) {
rc = 1;
}
-fail_bos_ProcessAllStopAndRestart:
+ fail_bos_ProcessAllStopAndRestart:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_AdminCreate(
- const void *serverHandle,
- const char *adminName,
- afs_status_p st)
+int ADMINAPI
+bos_AdminCreate(const void *serverHandle, const char *adminName,
+ afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_AdminCreate;
}
tst = ADMBOSADMINNAMENULL;
goto fail_bos_AdminCreate;
}
-
- tst = BOZO_AddSUser(b_handle->server, adminName);
-
+
+ tst = BOZO_AddSUser(b_handle->server, (char *)adminName);
+
if (tst == 0) {
rc = 1;
}
-fail_bos_AdminCreate:
+ fail_bos_AdminCreate:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_AdminDelete(
- const void *serverHandle,
- const char *adminName,
- afs_status_p st)
+int ADMINAPI
+bos_AdminDelete(const void *serverHandle, const char *adminName,
+ afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_AdminDelete;
}
tst = ADMBOSADMINNAMENULL;
goto fail_bos_AdminDelete;
}
-
- tst = BOZO_DeleteSUser(b_handle->server, adminName);
-
+
+ tst = BOZO_DeleteSUser(b_handle->server, (char *)adminName);
+
if (tst == 0) {
rc = 1;
}
-fail_bos_AdminDelete:
+ fail_bos_AdminDelete:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*/
typedef struct admin_get {
- int next;
- struct rx_connection *server;
- char admin[CACHED_ITEMS][BOS_MAX_NAME_LEN];
+ int next;
+ struct rx_connection *server;
+ char admin[CACHED_ITEMS][BOS_MAX_NAME_LEN];
} admin_get_t, *admin_get_p;
-static int GetAdminRPC(
- void *rpc_specific,
- int slot,
- int *last_item,
- int *last_item_contains_data,
- afs_status_p st)
+static int
+GetAdminRPC(void *rpc_specific, int slot, int *last_item,
+ int *last_item_contains_data, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
admin_get_p admin = (admin_get_p) rpc_specific;
- char *ptr = (char *) &admin->admin[slot];
+ char *ptr = (char *)&admin->admin[slot];
tst = BOZO_ListSUsers(admin->server, admin->next++, &ptr);
return rc;
}
-static int GetAdminFromCache(
- void *rpc_specific,
- int slot,
- void *dest,
- afs_status_p st)
+static int
+GetAdminFromCache(void *rpc_specific, int slot, void *dest, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
admin_get_p admin = (admin_get_p) rpc_specific;
- strcpy((char *) dest, (char *) &admin->admin[slot]);
+ strcpy((char *)dest, (char *)&admin->admin[slot]);
rc = 1;
if (st != NULL) {
}
return rc;
}
-
+
/*
* bos_AdminGetBegin - begin iterating over the administrators.
*
*
*/
-int ADMINAPI bos_AdminGetBegin(
- const void *serverHandle,
- void **iterationIdP,
- afs_status_p st)
+int ADMINAPI
+bos_AdminGetBegin(const void *serverHandle, void **iterationIdP,
+ afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
- afs_admin_iterator_p iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
- admin_get_p admin = (admin_get_p) malloc(sizeof(admin_get_t));
-
+ afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
+ admin_get_p admin = malloc(sizeof(admin_get_t));
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_AdminGetBegin;
}
-
+
if (iterationIdP == NULL) {
tst = ADMITERATIONIDPNULL;
goto fail_bos_AdminGetBegin;
admin->next = 0;
admin->server = b_handle->server;
- if (IteratorInit(iter, (void *) admin, GetAdminRPC,
- GetAdminFromCache, NULL, NULL, &tst)) {
- *iterationIdP = (void *) iter;
+ if (IteratorInit
+ (iter, (void *)admin, GetAdminRPC, GetAdminFromCache, NULL, NULL,
+ &tst)) {
+ *iterationIdP = (void *)iter;
rc = 1;
}
-fail_bos_AdminGetBegin:
+ fail_bos_AdminGetBegin:
if (rc == 0) {
if (iter != NULL) {
}
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
* Returns != 0 upon successful completion.
*
*/
-
-int ADMINAPI bos_AdminGetNext(
- const void *iterationId,
- char *adminName,
- afs_status_p st)
+
+int ADMINAPI
+bos_AdminGetNext(const void *iterationId, char *adminName, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
-
+
if (iterationId == NULL) {
tst = ADMITERATIONIDPNULL;
goto fail_bos_AdminGetNext;
goto fail_bos_AdminGetNext;
}
- rc = IteratorNext(iter, (void *) adminName, &tst);
+ rc = IteratorNext(iter, (void *)adminName, &tst);
-fail_bos_AdminGetNext:
+ fail_bos_AdminGetNext:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_AdminGetDone(
- const void *iterationId,
- afs_status_p st)
+int ADMINAPI
+bos_AdminGetDone(const void *iterationId, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
-
+
if (iterationId == NULL) {
tst = ADMITERATIONIDPNULL;
goto fail_bos_AdminGetDone;
rc = IteratorDone(iter, &tst);
-fail_bos_AdminGetDone:
+ fail_bos_AdminGetDone:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_KeyCreate(
- const void *serverHandle,
- int keyVersionNumber,
- const kas_encryptionKey_p key,
- afs_status_p st)
+int ADMINAPI
+bos_KeyCreate(const void *serverHandle, int keyVersionNumber,
+ const kas_encryptionKey_p key, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_KeyCreate;
}
tst = ADMBOSKEYNULL;
goto fail_bos_KeyCreate;
}
-
- tst = BOZO_AddKey(b_handle->server_encrypt, keyVersionNumber, key);
+
+ tst = BOZO_AddKey(b_handle->server_encrypt, keyVersionNumber, kas_to_bozoptr(key));
if (tst == 0) {
rc = 1;
}
-fail_bos_KeyCreate:
+ fail_bos_KeyCreate:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_KeyDelete(
- const void *serverHandle,
- int keyVersionNumber,
- afs_status_p st)
+int ADMINAPI
+bos_KeyDelete(const void *serverHandle, int keyVersionNumber, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_KeyDelete;
}
-
+
tst = BOZO_DeleteKey(b_handle->server, keyVersionNumber);
if (tst == 0) {
rc = 1;
}
-fail_bos_KeyDelete:
+ fail_bos_KeyDelete:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*/
typedef struct key_get {
- int next;
- struct rx_connection *server;
- bos_KeyInfo_t key[CACHED_ITEMS];
+ int next;
+ struct rx_connection *server;
+ bos_KeyInfo_t key[CACHED_ITEMS];
} key_get_t, *key_get_p;
-static int GetKeyRPC(
- void *rpc_specific,
- int slot,
- int *last_item,
- int *last_item_contains_data,
- afs_status_p st)
+static int
+GetKeyRPC(void *rpc_specific, int slot, int *last_item,
+ int *last_item_contains_data, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
key_get_p key = (key_get_p) rpc_specific;
- char *ptr = (char *) &key->key[slot];
struct bozo_keyInfo keyInfo;
- tst = BOZO_ListKeys(key->server, key->next++,
- &key->key[slot].keyVersionNumber,
- &key->key[slot].key, &keyInfo);
-
+ tst =
+ BOZO_ListKeys(key->server, key->next++,
+ &key->key[slot].keyVersionNumber, kas_to_bozoptr(&key->key[slot].key),
+ &keyInfo);
+
if (tst == 0) {
key->key[slot].keyStatus.lastModificationDate = keyInfo.mod_sec;
- key->key[slot].keyStatus.lastModificationMicroSeconds =
- keyInfo.mod_usec;
+ key->key[slot].keyStatus.lastModificationMicroSeconds =
+ keyInfo.mod_usec;
key->key[slot].keyStatus.checkSum = keyInfo.keyCheckSum;
rc = 1;
} else if (tst == BZDOM) {
return rc;
}
-static int GetKeyFromCache(
- void *rpc_specific,
- int slot,
- void *dest,
- afs_status_p st)
+static int
+GetKeyFromCache(void *rpc_specific, int slot, void *dest, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
}
return rc;
}
-
+
/*
* bos_KeyGetBegin - begin iterating over the keys.
*
*
*/
-int ADMINAPI bos_KeyGetBegin(
- const void *serverHandle,
- void **iterationIdP,
- afs_status_p st)
+int ADMINAPI
+bos_KeyGetBegin(const void *serverHandle, void **iterationIdP,
+ afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
- afs_admin_iterator_p iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
- key_get_p key = (key_get_p) malloc(sizeof(key_get_t));
-
+ afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
+ key_get_p key = malloc(sizeof(key_get_t));
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_KeyGetBegin;
}
-
+
if (iterationIdP == NULL) {
tst = ADMITERATIONIDPNULL;
goto fail_bos_KeyGetBegin;
key->next = 0;
key->server = b_handle->server_encrypt;
- if (IteratorInit(iter, (void *) key, GetKeyRPC,
- GetKeyFromCache, NULL, NULL, &tst)) {
- *iterationIdP = (void *) iter;
+ if (IteratorInit
+ (iter, (void *)key, GetKeyRPC, GetKeyFromCache, NULL, NULL, &tst)) {
+ *iterationIdP = (void *)iter;
rc = 1;
}
-fail_bos_KeyGetBegin:
+ fail_bos_KeyGetBegin:
if (rc == 0) {
if (iter != NULL) {
}
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_KeyGetNext(
- const void *iterationId,
- bos_KeyInfo_p keyP,
- afs_status_p st)
+int ADMINAPI
+bos_KeyGetNext(const void *iterationId, bos_KeyInfo_p keyP, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
-
+
if (iterationId == NULL) {
tst = ADMITERATIONIDPNULL;
goto fail_bos_KeyGetNext;
}
-
+
if (keyP == NULL) {
tst = ADMBOSKEYPNULL;
goto fail_bos_KeyGetNext;
}
- rc = IteratorNext(iter, (void *) keyP, &tst);
+ rc = IteratorNext(iter, (void *)keyP, &tst);
-fail_bos_KeyGetNext:
+ fail_bos_KeyGetNext:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_KeyGetDone(
- const void *iterationId,
- afs_status_p st)
+int ADMINAPI
+bos_KeyGetDone(const void *iterationId, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
-
+
if (iterationId == NULL) {
tst = ADMITERATIONIDPNULL;
goto fail_bos_KeyGetDone;
rc = IteratorDone(iter, &tst);
-fail_bos_KeyGetDone:
+ fail_bos_KeyGetDone:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
* Returns != 0 upon successful completion.
*/
-int ADMINAPI bos_CellSet(
- const void *serverHandle,
- const char *cellName,
- afs_status_p st)
+int ADMINAPI
+bos_CellSet(const void *serverHandle, const char *cellName, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_CellSet;
}
tst = ADMCLIENTCELLNAMENULL;
goto fail_bos_CellSet;
}
-
- tst = BOZO_SetCellName(b_handle->server, cellName);
+
+ tst = BOZO_SetCellName(b_handle->server, (char *)cellName);
if (tst == 0) {
rc = 1;
}
-fail_bos_CellSet:
+ fail_bos_CellSet:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
* Returns != 0 upon successful completion.
*/
-int ADMINAPI bos_CellGet(
- const void *serverHandle,
- char *cellName,
- afs_status_p st)
+int ADMINAPI
+bos_CellGet(const void *serverHandle, char *cellName, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_CellGet;
}
tst = ADMCLIENTCELLNAMENULL;
goto fail_bos_CellGet;
}
-
+
tst = BOZO_GetCellName(b_handle->server, &cellName);
if (tst == 0) {
rc = 1;
}
-
-fail_bos_CellGet:
+
+ fail_bos_CellGet:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
-
+
/*
* bos_HostCreate - add a new host to the cell.
*
* Returns != 0 upon successful completion.
*/
-int ADMINAPI bos_HostCreate(
- const void *serverHandle,
- const char *hostName,
- afs_status_p st)
+int ADMINAPI
+bos_HostCreate(const void *serverHandle, const char *hostName,
+ afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_HostCreate;
}
tst = ADMBOSHOSTNAMENULL;
goto fail_bos_HostCreate;
}
-
- tst = BOZO_AddCellHost(b_handle->server, hostName);
+
+ tst = BOZO_AddCellHost(b_handle->server, (char *)hostName);
if (tst == 0) {
rc = 1;
}
-
-fail_bos_HostCreate:
+
+ fail_bos_HostCreate:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
-
+
/*
* bos_HostDelete - delete a host from the cell.
*
* Returns != 0 upon successful completion.
*/
-int ADMINAPI bos_HostDelete(
- const void *serverHandle,
- const char *hostName,
- afs_status_p st)
+int ADMINAPI
+bos_HostDelete(const void *serverHandle, const char *hostName,
+ afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_HostDelete;
}
-
+
if ((hostName == NULL) || (*hostName == 0)) {
tst = ADMBOSHOSTNAMENULL;
goto fail_bos_HostDelete;
}
-
- tst = BOZO_DeleteCellHost(b_handle->server, hostName);
+
+ tst = BOZO_DeleteCellHost(b_handle->server, (char *)hostName);
if (tst == 0) {
rc = 1;
}
-fail_bos_HostDelete:
+ fail_bos_HostDelete:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*/
typedef struct host_get {
- int next;
- struct rx_connection *server;
- char host[CACHED_ITEMS][BOS_MAX_NAME_LEN];
+ int next;
+ struct rx_connection *server;
+ char host[CACHED_ITEMS][BOS_MAX_NAME_LEN];
} host_get_t, *host_get_p;
-static int GetHostRPC(
- void *rpc_specific,
- int slot,
- int *last_item,
- int *last_item_contains_data,
- afs_status_p st)
+static int
+GetHostRPC(void *rpc_specific, int slot, int *last_item,
+ int *last_item_contains_data, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
host_get_p host = (host_get_p) rpc_specific;
- char *ptr = (char *) &host->host[slot];
+ char *ptr = (char *)&host->host[slot];
tst = BOZO_GetCellHost(host->server, host->next++, &ptr);
return rc;
}
-static int GetHostFromCache(
- void *rpc_specific,
- int slot,
- void *dest,
- afs_status_p st)
+static int
+GetHostFromCache(void *rpc_specific, int slot, void *dest, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
host_get_p host = (host_get_p) rpc_specific;
- strcpy((char *) dest, (char *) &host->host[slot]);
+ strcpy((char *)dest, (char *)&host->host[slot]);
rc = 1;
if (st != NULL) {
}
return rc;
}
-
+
/*
* bos_HostGetBegin - begin iterating over the hosts in a cell
* at a particular bos server.
*
*/
-int ADMINAPI bos_HostGetBegin(
- const void *serverHandle,
- void **iterationIdP,
- afs_status_p st)
+int ADMINAPI
+bos_HostGetBegin(const void *serverHandle, void **iterationIdP,
+ afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
- afs_admin_iterator_p iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
- host_get_p host = (host_get_p) malloc(sizeof(host_get_t));
-
+ afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
+ host_get_p host = malloc(sizeof(host_get_t));
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_HostGetBegin;
}
-
+
if (iterationIdP == NULL) {
tst = ADMITERATIONIDPNULL;
goto fail_bos_HostGetBegin;
host->next = 0;
host->server = b_handle->server;
- if (IteratorInit(iter, (void *) host, GetHostRPC,
- GetHostFromCache, NULL, NULL, &tst)) {
- *iterationIdP = (void *) iter;
+ if (IteratorInit
+ (iter, (void *)host, GetHostRPC, GetHostFromCache, NULL, NULL,
+ &tst)) {
+ *iterationIdP = (void *)iter;
rc = 1;
}
-fail_bos_HostGetBegin:
+ fail_bos_HostGetBegin:
if (rc == 0) {
if (iter != NULL) {
}
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_HostGetNext(
- const void *iterationId,
- char *hostName,
- afs_status_p st)
+int ADMINAPI
+bos_HostGetNext(const void *iterationId, char *hostName, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
-
+
if (iterationId == NULL) {
tst = ADMITERATIONIDPNULL;
goto fail_bos_HostGetNext;
}
-
+
if (hostName == NULL) {
tst = ADMBOSHOSTNAMENULL;
goto fail_bos_HostGetNext;
}
- rc = IteratorNext(iter, (void *) hostName, &tst);
+ rc = IteratorNext(iter, (void *)hostName, &tst);
-fail_bos_HostGetNext:
+ fail_bos_HostGetNext:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_HostGetDone(
- const void *iterationId,
- afs_status_p st)
+int ADMINAPI
+bos_HostGetDone(const void *iterationId, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
-
+
if (iterationId == NULL) {
tst = ADMITERATIONIDPNULL;
goto fail_bos_HostGetDone;
rc = IteratorDone(iter, &tst);
-fail_bos_HostGetDone:
+ fail_bos_HostGetDone:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_ExecutableCreate(
- const void *serverHandle,
- const char *sourceFile,
- const char *destFile,
- afs_status_p st)
+int ADMINAPI
+bos_ExecutableCreate(const void *serverHandle, const char *sourceFile,
+ const char *destFile, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
int fd;
struct stat estat;
struct rx_call *tcall;
-
+
/*
* Validate arguments
*/
tcall = rx_NewCall(b_handle->server);
- tst = StartBOZO_Install(tcall, destFile, estat.st_size,
- (afs_int32) estat.st_mode, estat.st_mtime);
-
+ tst =
+ StartBOZO_Install(tcall, (char *)destFile, estat.st_size,
+ (afs_int32) estat.st_mode, estat.st_mtime);
+
if (tst) {
rx_EndCall(tcall, tst);
goto fail_bos_ExecutableCreate;
* Copy the data to the server
*/
- while(1) {
+ while (1) {
char tbuffer[512];
- size_t len;
+ ssize_t len;
len = read(fd, tbuffer, sizeof(tbuffer));
if (len < 0) {
tst = ADMBOSCANTREADSOURCEFILE;
rc = 1;
}
-fail_bos_ExecutableCreate:
+ fail_bos_ExecutableCreate:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_ExecutableRevert(
- const void *serverHandle,
- const char *execFile,
- afs_status_p st)
+int ADMINAPI
+bos_ExecutableRevert(const void *serverHandle, const char *execFile,
+ afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_ExecutableRevert;
}
goto fail_bos_ExecutableRevert;
}
- tst = BOZO_UnInstall(b_handle->server, execFile);
+ tst = BOZO_UnInstall(b_handle->server, (char *)execFile);
if (tst == 0) {
rc = 1;
}
-fail_bos_ExecutableRevert:
+ fail_bos_ExecutableRevert:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_ExecutableTimestampGet(
- const void *serverHandle,
- const char *execFile,
- unsigned long *newTime,
- unsigned long *oldTime,
- unsigned long *bakTime,
- afs_status_p st)
+int ADMINAPI
+bos_ExecutableTimestampGet(const void *serverHandle, const char *execFile,
+ afs_int32 *newTime, afs_int32 *oldTime,
+ afs_int32 *bakTime, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_ExecutableTimestampGet;
}
-
+
if ((execFile == NULL) || (*execFile == 0)) {
tst = ADMBOSEXECFILENULL;
goto fail_bos_ExecutableTimestampGet;
tst = ADMBOSBAKTIMENULL;
goto fail_bos_ExecutableTimestampGet;
}
-
- tst = BOZO_GetDates(b_handle->server, execFile, newTime, bakTime, oldTime);
+
+ tst =
+ BOZO_GetDates(b_handle->server, (char *)execFile, newTime, bakTime, oldTime);
if (tst == 0) {
rc = 1;
}
-
-fail_bos_ExecutableTimestampGet:
+
+ fail_bos_ExecutableTimestampGet:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_ExecutablePrune(
- const void *serverHandle,
- bos_Prune_t oldFiles,
- bos_Prune_t bakFiles,
- bos_Prune_t coreFiles,
- afs_status_p st)
+int ADMINAPI
+bos_ExecutablePrune(const void *serverHandle, bos_Prune_t oldFiles,
+ bos_Prune_t bakFiles, bos_Prune_t coreFiles,
+ afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
afs_int32 flags = 0;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_ExecutablePrune;
}
if (tst == 0) {
rc = 1;
}
-
-fail_bos_ExecutablePrune:
+
+ fail_bos_ExecutablePrune:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_ExecutableRestartTimeSet(
- const void *serverHandle,
- bos_Restart_t type,
- bos_RestartTime_t time,
- afs_status_p st)
+int ADMINAPI
+bos_ExecutableRestartTimeSet(const void *serverHandle, bos_Restart_t type,
+ bos_RestartTime_t time, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
afs_int32 restartType = 0;
- struct ktime restartTime;
-
+ struct bozo_netKTime restartTime;
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_ExecutableRestartTimeSet;
}
-
+
if (type == BOS_RESTART_WEEKLY) {
restartType = 1;
} else {
restartType = 2;
}
- if ((time.mask & BOS_RESTART_TIME_HOUR) &&
- (time.hour < 0) || (time.hour > 23)) {
+ if ((time.mask & BOS_RESTART_TIME_HOUR)
+ && ((time.hour < 0) || (time.hour > 23))) {
tst = ADMBOSHOURINVALID;
goto fail_bos_ExecutableRestartTimeSet;
}
- if ((time.mask & BOS_RESTART_TIME_MINUTE) &&
- (time.min < 0) || (time.min > 60)) {
+ if ((time.mask & BOS_RESTART_TIME_MINUTE)
+ && ((time.min < 0) || (time.min > 60))) {
tst = ADMBOSMINUTEINVALID;
goto fail_bos_ExecutableRestartTimeSet;
}
- if ((time.mask & BOS_RESTART_TIME_SECOND) &&
- (time.sec < 0) || (time.sec > 60)) {
+ if ((time.mask & BOS_RESTART_TIME_SECOND)
+ && ((time.sec < 0) || (time.sec > 60))) {
tst = ADMBOSSECONDINVALID;
goto fail_bos_ExecutableRestartTimeSet;
}
- if ((time.mask & BOS_RESTART_TIME_DAY) &&
- (time.day < 0) || (time.day > 6)) {
+ if ((time.mask & BOS_RESTART_TIME_DAY)
+ && ((time.day < 0) || (time.day > 6))) {
tst = ADMBOSDAYINVALID;
goto fail_bos_ExecutableRestartTimeSet;
}
restartTime.sec = time.sec;
restartTime.day = time.day;
- tst = BOZO_SetRestartTime(b_handle->server, restartType, restartTime);
+ tst = BOZO_SetRestartTime(b_handle->server, restartType, &restartTime);
if (tst == 0) {
rc = 1;
}
-
-fail_bos_ExecutableRestartTimeSet:
+
+ fail_bos_ExecutableRestartTimeSet:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_ExecutableRestartTimeGet(
- const void *serverHandle,
- bos_Restart_t type,
- bos_RestartTime_p timeP,
- afs_status_p st)
+int ADMINAPI
+bos_ExecutableRestartTimeGet(const void *serverHandle, bos_Restart_t type,
+ bos_RestartTime_p timeP, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
afs_int32 restartType = 0;
- struct ktime restartTime;
-
+ struct bozo_netKTime restartTime;
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_ExecutableRestartTimeGet;
}
tst = ADMBOSTIMEPNULL;
goto fail_bos_ExecutableRestartTimeGet;
}
-
+
if (type == BOS_RESTART_WEEKLY) {
restartType = 1;
} else {
timeP->sec = restartTime.sec;
timeP->day = restartTime.day;
rc = 1;
-
-fail_bos_ExecutableRestartTimeGet:
+
+ fail_bos_ExecutableRestartTimeGet:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_LogGet(
- const void *serverHandle,
- const char *log,
- unsigned long *logBufferSizeP,
- char *logData,
- afs_status_p st)
+int ADMINAPI
+bos_LogGet(const void *serverHandle, const char *log,
+ unsigned long *logBufferSizeP, char *logData, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
- struct rx_call *tcall;
+ struct rx_call *tcall = NULL;
afs_int32 error;
char buffer;
int have_call = 0;
unsigned long bytes_read = 0;
-
+
/*
* Validate parameters
*/
tcall = rx_NewCall(b_handle->server);
have_call = 1;
- tst = StartBOZO_GetLog(tcall, log);
+ tst = StartBOZO_GetLog(tcall, (char *) log);
if (tst != 0) {
goto fail_bos_LogGet;
if (bytes_read <= *logBufferSizeP) {
*logData++ = buffer;
} else {
- tst = ADMMOREDATA;
+ tst = ADMMOREDATA;
}
}
if (tst == 0) {
rc = 1;
}
-
-fail_bos_LogGet:
+
+ fail_bos_LogGet:
if (have_call) {
rx_EndCall(tcall, 0);
}
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_AuthSet(
- const void *serverHandle,
- bos_Auth_t auth,
- afs_status_p st)
+int ADMINAPI
+bos_AuthSet(const void *serverHandle, bos_Auth_t auth, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
afs_int32 level = 0;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_AuthSet;
}
} else {
level = 1;
}
-
+
tst = BOZO_SetNoAuthFlag(b_handle->server, level);
if (tst == 0) {
rc = 1;
}
-fail_bos_AuthSet:
+ fail_bos_AuthSet:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
*
*/
-int ADMINAPI bos_CommandExecute(
- const void *serverHandle,
- const char *command,
- afs_status_p st)
+int ADMINAPI
+bos_CommandExecute(const void *serverHandle, const char *command,
+ afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
-
+
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_CommandExecute;
}
tst = ADMBOSCOMMANDNULL;
goto fail_bos_CommandExecute;
}
-
- tst = BOZO_Exec(b_handle->server, command);
+
+ tst = BOZO_Exec(b_handle->server, (char *) command);
if (tst == 0) {
rc = 1;
}
-fail_bos_CommandExecute:
+ fail_bos_CommandExecute:
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}
#define INITIAL_LOG_LEN 4096
-int ADMINAPI bos_Salvage(
- const void *cellHandle,
- const void *serverHandle,
- const char *partitionName,
- const char *volumeName,
- int numSalvagers,
- const char *tmpDir,
- const char *logFile,
- vos_force_t force,
- bos_SalvageDamagedVolumes_t salvageDamagedVolumes,
- bos_WriteInodes_t writeInodes,
- bos_WriteRootInodes_t writeRootInodes,
- bos_ForceDirectory_t forceDirectory,
- bos_ForceBlockRead_t forceBlockRead,
- afs_status_p st)
+int ADMINAPI
+bos_Salvage(const void *cellHandle, const void *serverHandle,
+ const char *partitionName, const char *volumeName,
+ int numSalvagers, const char *tmpDir, const char *logFile,
+ vos_force_t force,
+ bos_SalvageDamagedVolumes_t salvageDamagedVolumes,
+ bos_WriteInodes_t writeInodes,
+ bos_WriteRootInodes_t writeRootInodes,
+ bos_ForceDirectory_t forceDirectory,
+ bos_ForceBlockRead_t forceBlockRead, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
int have_volume = 0;
unsigned int part = 0;
int try_to_stop_fileserver = 0;
- int stopped_fileserver = 0;
bos_ProcessType_t procType;
bos_ProcessInfo_t procInfo;
FILE *log = NULL;
int poll_rc;
char *logData = NULL;
unsigned long logLen = INITIAL_LOG_LEN;
-
+
/*
* Validate arguments
*/
}
if (c_handle->vos_valid == 0) {
- tst = ADMBOSCELLHANDLENOVOS;
- goto fail_bos_Salvage;
+ tst = ADMBOSCELLHANDLENOVOS;
+ goto fail_bos_Salvage;
}
if ((partitionName != NULL) && (*partitionName != 0)) {
*/
if (try_to_stop_fileserver) {
- if (bos_ProcessInfoGet(serverHandle, "fs", &procType, &procInfo,
- &tst)) {
+ if (bos_ProcessInfoGet
+ (serverHandle, "fs", &procType, &procInfo, &tst)) {
if (procInfo.processGoal != BOS_PROCESS_RUNNING) {
- try_to_stop_fileserver = 0;
+ try_to_stop_fileserver = 0;
}
}
}
*/
if (try_to_stop_fileserver) {
- if (!bos_ProcessExecutionStateSetTemporary(serverHandle, "fs",
- BOS_PROCESS_STOPPED,
- &tst)) {
+ if (!bos_ProcessExecutionStateSetTemporary
+ (serverHandle, "fs", BOS_PROCESS_STOPPED, &tst)) {
goto fail_bos_Salvage;
}
bos_ProcessAllWaitTransition(serverHandle, &tst);
* Create the salvage command line arguments
*/
- command_len = sprintf(command, "%s ",
- AFSDIR_CANONICAL_SERVER_SALVAGER_FILEPATH);
+ command_len =
+ sprintf(command, "%s ", AFSDIR_CANONICAL_SERVER_SALVAGER_FILEPATH);
if (have_partition) {
- command_len += sprintf(&command[command_len], "-partition %s ",
- partitionName);
+ command_len +=
+ sprintf(&command[command_len], "-partition %s ", partitionName);
}
if (have_volume) {
- command_len += sprintf(&command[command_len], "-volumeid %s ",
- volumeName);
+ command_len +=
+ sprintf(&command[command_len], "-volumeid %s ", volumeName);
}
if (salvageDamagedVolumes == BOS_DONT_SALVAGE_DAMAGED_VOLUMES) {
command_len += sprintf(&command[command_len], "-blockreads ");
}
- command_len += sprintf(&command[command_len], "-parallel %d ", numSalvagers);
+ command_len +=
+ sprintf(&command[command_len], "-parallel %d ", numSalvagers);
if ((tmpDir != NULL) && (*tmpDir != 0)) {
command_len += sprintf(&command[command_len], "-tmpdir %s ", tmpDir);
* Create the process at the bosserver and wait until it completes
*/
- if (!bos_ProcessCreate(serverHandle, "salvage-tmp", BOS_PROCESS_CRON,
- command, "now", 0, &tst)) {
+ if (!bos_ProcessCreate
+ (serverHandle, "salvage-tmp", BOS_PROCESS_CRON, command, "now", 0,
+ &tst)) {
goto fail_bos_Salvage;
}
- while (poll_rc = bos_ProcessInfoGet(serverHandle, "salvage-tmp", &procType,
- &procInfo, &tst)) {
+ while ((poll_rc =
+ bos_ProcessInfoGet(serverHandle, "salvage-tmp", &procType,
+ &procInfo, &tst))) {
sleep(5);
}
if (log != NULL) {
- logData = (char *) malloc(INITIAL_LOG_LEN);
+ logData = malloc(INITIAL_LOG_LEN);
if (!logData) {
tst = ADMNOMEM;
goto fail_bos_Salvage;
}
- while(!bos_LogGet(serverHandle,
- AFSDIR_CANONICAL_SERVER_SLVGLOG_FILEPATH,
- &logLen, logData, &tst)) {
+ while (!bos_LogGet
+ (serverHandle, AFSDIR_CANONICAL_SERVER_SLVGLOG_FILEPATH,
+ &logLen, logData, &tst)) {
if (logLen > INITIAL_LOG_LEN) {
- logData = (char *) realloc(logData, (logLen + (logLen / 10)));
+ logData = realloc(logData, (logLen + (logLen / 10)));
if (logData == NULL) {
tst = ADMNOMEM;
goto fail_bos_Salvage;
if (try_to_stop_fileserver) {
try_to_stop_fileserver = 0;
- if (!bos_ProcessExecutionStateSetTemporary(serverHandle, "fs",
- BOS_PROCESS_RUNNING,
- &tst)) {
+ if (!bos_ProcessExecutionStateSetTemporary
+ (serverHandle, "fs", BOS_PROCESS_RUNNING, &tst)) {
goto fail_bos_Salvage;
}
}
rc = 1;
-fail_bos_Salvage:
+ fail_bos_Salvage:
if (log != NULL) {
fclose(log);
}
if (st != NULL) {
- *st = tst;
+ *st = tst;
}
return rc;
}