LogDebug(3, "%d servers\n", nservers);
/* now can allocate the space for the server arguments */
- serverArgs = (char **)malloc((nservers + 2) * sizeof(char *));
+ serverArgs = malloc((nservers + 2) * sizeof(char *));
if (serverArgs == 0)
ERROR(-1);
ERROR(code);
/* free space for the server args */
- free((char *)serverArgs);
+ free(serverArgs);
error_exit:
return (code);
afs_int32 code = 0;
int fd;
- path = malloc(strlen(globalConfPtr->databaseDirectory) +
- strlen(globalConfPtr->databaseName) +
- strlen(globalConfPtr->databaseExtension) + 1);
+ asprintf(&path, "%s%s%s",
+ globalConfPtr->databaseDirectory,
+ globalConfPtr->databaseName,
+ globalConfPtr->databaseExtension);
if (path == NULL)
ERROR(-1);
- /* construct the database name */
- strcpy(path, globalConfPtr->databaseDirectory);
- strcat(path, globalConfPtr->databaseName);
- strcat(path, globalConfPtr->databaseExtension);
-
fd = open(path, O_RDWR, 0755);
if (!fd) {
code = errno;
code = afsconf_GetExtendedCellInfo (BU_conf, lcell, 0, &cellinfo,
clones);
+ if (code) {
+ LogError(0, "Can't read cell information\n");
+ ERROR(code);
+ }
+
code =
convert_cell_to_ubik(&cellinfo, &globalConfPtr->myHost,
globalConfPtr->serverList);
LogError(0, "Will allocate %d ubik buffers\n", ubik_nBuffers);
- dbNamePtr =
- (char *)malloc(strlen(globalConfPtr->databaseDirectory) +
- strlen(globalConfPtr->databaseName) + 1);
+ asprintf(&dbNamePtr, "%s%s", globalConfPtr->databaseDirectory,
+ globalConfPtr->databaseName);
if (dbNamePtr == 0)
ERROR(-1);
- /* construct the database name */
- strcpy(dbNamePtr, globalConfPtr->databaseDirectory);
- strcat(dbNamePtr, globalConfPtr->databaseName); /* name prefix */
-
rx_SetRxDeadTime(60); /* 60 seconds inactive before timeout */
if (rxBind) {
if (AFSDIR_SERVER_NETRESTRICT_FILEPATH ||
AFSDIR_SERVER_NETINFO_FILEPATH) {
char reason[1024];
- ccode = parseNetFiles(SHostAddrs, NULL, NULL,
- ADDRSPERSITE, reason,
- AFSDIR_SERVER_NETINFO_FILEPATH,
- AFSDIR_SERVER_NETRESTRICT_FILEPATH);
+ ccode = afsconf_ParseNetFiles(SHostAddrs, NULL, NULL,
+ ADDRSPERSITE, reason,
+ AFSDIR_SERVER_NETINFO_FILEPATH,
+ AFSDIR_SERVER_NETRESTRICT_FILEPATH);
} else
{
ccode = rx_getAllAddr(SHostAddrs, ADDRSPERSITE);