#endif
/* Remember the name of the process, if any, that failed last */
-static void RememberProcName(ap)
-register struct bnode_proc *ap; {
+static void RememberProcName(register struct bnode_proc *ap)
+{
register struct bnode *tbnodep;
tbnodep = ap->bnode;
/* utility for use by BOP_HASCORE functions to determine where a core file might
* be stored.
*/
-bnode_CoreName(abnode, acoreName, abuffer)
-register struct bnode *abnode;
-char *acoreName;
-char *abuffer; {
+int bnode_CoreName(register struct bnode *abnode, char *acoreName,
+ char *abuffer)
+{
strcpy(abuffer, AFSDIR_SERVER_CORELOG_FILEPATH);
if (acoreName) {
strcat(abuffer, acoreName);
}
/* save core file, if any */
-static void SaveCore(abnode, aproc)
-register struct bnode_proc *aproc;
-register struct bnode *abnode; {
+static void SaveCore(register struct bnode *abnode, register struct bnode_proc
+ *aproc)
+{
char tbuffer[256];
struct stat tstat;
register afs_int32 code;
code = renamefile(AFSDIR_SERVER_CORELOG_FILEPATH, tbuffer);
}
-bnode_GetString(abnode, abuffer, alen)
-register struct bnode *abnode;
-register char *abuffer;
-register afs_int32 alen;{
+int bnode_GetString(register struct bnode *abnode, register char *abuffer,
+register afs_int32 alen)
+{
return BOP_GETSTRING(abnode, abuffer, alen);
}
-bnode_GetParm(abnode, aindex, abuffer, alen)
-register struct bnode *abnode;
-register afs_int32 aindex;
-register char *abuffer;
-afs_int32 alen; {
+int bnode_GetParm(register struct bnode *abnode, register afs_int32 aindex,
+ register char *abuffer, afs_int32 alen)
+{
return BOP_GETPARM(abnode, aindex, abuffer, alen);
}
-bnode_GetStat(abnode, astatus)
-register struct bnode *abnode;
-register afs_int32 *astatus; {
+int bnode_GetStat(register struct bnode *abnode, register afs_int32 *astatus)
+{
return BOP_GETSTAT(abnode, astatus);
}
-bnode_RestartP(abnode)
-register struct bnode *abnode; {
+int bnode_RestartP(register struct bnode *abnode)
+{
return BOP_RESTARTP(abnode);
}
-static bnode_Check(abnode)
-register struct bnode *abnode; {
+static int bnode_Check(register struct bnode *abnode)
+{
if (abnode->flags & BNODE_WAIT) {
abnode->flags &= ~BNODE_WAIT;
LWP_NoYieldSignal(abnode);
}
/* tell if an instance has a core file */
-bnode_HasCore(abnode)
-register struct bnode *abnode; {
+int bnode_HasCore(register struct bnode *abnode)
+{
return BOP_HASCORE(abnode);
}
/* wait for all bnodes to stabilize */
-bnode_WaitAll() {
+int bnode_WaitAll() {
register struct bnode *tb;
register afs_int32 code;
afs_int32 stat;
}
/* wait until bnode status is correct */
-bnode_WaitStatus(abnode, astatus)
-int astatus;
-register struct bnode *abnode; {
+int bnode_WaitStatus(register struct bnode *abnode, int astatus)
+{
register afs_int32 code;
afs_int32 stat;
}
}
-bnode_SetStat(abnode, agoal)
-register struct bnode *abnode;
-register int agoal; {
+int bnode_SetStat(register struct bnode *abnode, register int agoal)
+{
abnode->goal = agoal;
bnode_Check(abnode);
BOP_SETSTAT(abnode, agoal);
return 0;
}
-bnode_SetGoal(abnode, agoal)
-register struct bnode *abnode;
-register int agoal; {
+int bnode_SetGoal(register struct bnode *abnode, register int agoal)
+{
abnode->goal = agoal;
bnode_Check(abnode);
return 0;
}
-bnode_SetFileGoal(abnode, agoal)
-register struct bnode *abnode;
-register int agoal; {
+int bnode_SetFileGoal(register struct bnode *abnode, register int agoal)
+{
if (abnode->fileGoal == agoal) return 0; /* already done */
abnode->fileGoal = agoal;
WriteBozoFile(0);
}
/* apply a function to all bnodes in the system */
-int bnode_ApplyInstance(aproc, arock)
-int (*aproc)();
-char *arock; {
+int bnode_ApplyInstance(int (*aproc)(), char *arock)
+{
register struct bnode *tb, *nb;
register afs_int32 code;
return 0;
}
-struct bnode *bnode_FindInstance (aname)
-register char *aname; {
+struct bnode *bnode_FindInstance(register char *aname)
+{
register struct bnode *tb;
for(tb=allBnodes;tb;tb=tb->next) {
return NULL;
}
-static struct bnode_type *FindType(aname)
-register char *aname; {
+static struct bnode_type *FindType(register char *aname)
+{
register struct bnode_type *tt;
for(tt=allTypes;tt;tt=tt->next) {
return (struct bnode_type *) 0;
}
-bnode_Register(atype, aprocs, anparms)
-char *atype;
-int anparms; /* number of parms to create */
-struct bnode_ops *aprocs; {
+int bnode_Register(char *atype, struct bnode_ops *aprocs, int anparms)
+{
register struct bnode_type *tt;
for(tt=allTypes;tt;tt=tt->next) {
return 0;
}
-afs_int32 bnode_Create(atype, ainstance, abp, ap1, ap2, ap3, ap4, ap5, notifier,fileGoal)
-char *atype;
-char *ainstance;
-struct bnode **abp;
-char *ap1, *ap2, *ap3, *ap4, *ap5, *notifier;
-int fileGoal;{
+afs_int32 bnode_Create(char *atype, char *ainstance, struct bnode **abp,
+ char *ap1, char *ap2, char *ap3, char *ap4,
+ char *ap5, char *notifier, int fileGoal)
+{
struct bnode_type *type;
struct bnode *tb;
char *notifierpath = NULL;
return 0;
}
-int bnode_DeleteName(ainstance)
-char *ainstance; {
+int bnode_DeleteName(char *ainstance)
+{
register struct bnode *tb;
tb = bnode_FindInstance(ainstance);
return bnode_Delete(tb);
}
-bnode_Hold(abnode)
-register struct bnode *abnode; {
+int bnode_Hold(register struct bnode *abnode)
+{
abnode->refCount++;
return 0;
}
-bnode_Release(abnode)
-register struct bnode *abnode; {
+int bnode_Release(register struct bnode *abnode)
+{
abnode->refCount--;
if (abnode->refCount == 0 && abnode->flags & BNODE_DELETE) {
abnode->flags &= ~BNODE_DELETE; /* we're going for it */
return 0;
}
-int bnode_Delete(abnode)
-register struct bnode *abnode; {
+int bnode_Delete(register struct bnode *abnode)
+{
register afs_int32 code;
register struct bnode **lb, *ub;
afs_int32 temp;
}
/* function to tell if there's a timeout coming up */
-int bnode_PendingTimeout(abnode)
-register struct bnode *abnode; {
+int bnode_PendingTimeout(register struct bnode *abnode)
+{
return (abnode->flags & BNODE_NEEDTIMEOUT);
}
/* function called to set / clear periodic bnode wakeup times */
-int bnode_SetTimeout(abnode, atimeout)
-register struct bnode *abnode;
-afs_int32 atimeout; {
+int bnode_SetTimeout(register struct bnode *abnode, afs_int32 atimeout)
+{
if (atimeout != 0) {
abnode->nextTimeout = FT_ApproxTime() + atimeout;
abnode->flags |= BNODE_NEEDTIMEOUT;
}
/* used by new bnode creation code to format bnode header */
-int bnode_InitBnode (abnode, abnodeops, aname)
-register struct bnode *abnode;
-char *aname;
-struct bnode_ops *abnodeops; {
+int bnode_InitBnode (register struct bnode *abnode,
+ struct bnode_ops *abnodeops, char *aname)
+{
struct bnode **lb, *nb;
/* format the bnode properly */
memset(abnode, 0, sizeof(struct bnode));
abnode->ops = abnodeops;
abnode->name = (char *) malloc(strlen(aname)+1);
+ if (!abnode->name)
+ return ENOMEM;
strcpy(abnode->name, aname);
abnode->flags = BNODE_ACTIVE;
abnode->fileGoal = BSTAT_NORMAL;
}
-#ifdef notdef
-sigcatch()
-{
- signal(SIGPIPE, SIG_IGN);
- bozo_Log("Notifier aborted prematurely");
- exit(0);
-}
-#endif
-
-
-
-hdl_notifier(tp)
- struct bnode_proc *tp;
+int hdl_notifier(struct bnode_proc *tp)
{
#ifndef AFS_NT40_ENV /* NT notifier callout not yet implemented */
int code, pid, status;
}
-static afs_int32 SendNotifierData(fd, tp)
- register int fd;
- register struct bnode_proc *tp;
+static afs_int32 SendNotifierData(register int fd,
+ register struct bnode_proc *tp)
{
register struct bnode *tb = tp->bnode;
char buffer[1000], *bufp = buffer, *buf1;
/* Called by IOMGR at low priority on IOMGR's stack shortly after a SIGCHLD
* occurs. Wakes up bproc do redo things */
-bnode_SoftInt(int asignal)
+int bnode_SoftInt(int asignal)
{
IOMGR_Cancel(bproc_pid);
return 0;
/* Called at signal interrupt level; queues function to be called
* when IOMGR runs again.
*/
-void
-bnode_Int(int asignal)
+void bnode_Int(int asignal)
{
extern void bozo_ShutdownAndExit();
}
/* free token list returned by parseLine */
-bnode_FreeTokens(alist)
- register struct bnode_token *alist; {
+int bnode_FreeTokens(register struct bnode_token *alist)
+{
register struct bnode_token *nlist;
for(; alist; alist = nlist) {
nlist = alist->next;
return 0;
}
-static space(x)
-int x; {
+static int space(int x)
+{
if (x == 0 || x == ' ' || x == '\t' || x== '\n') return 1;
else return 0;
}
-bnode_ParseLine(aline, alist)
- char *aline;
- struct bnode_token **alist; {
+int bnode_ParseLine(char *aline, struct bnode_token **alist)
+{
char tbuffer[256];
register char *tptr;
int inToken;
}
#define MAXVARGS 128
-int bnode_NewProc(abnode, aexecString, coreName, aproc)
-struct bnode_proc **aproc;
-char *coreName;
-struct bnode *abnode;
-char *aexecString; {
+int bnode_NewProc(struct bnode *abnode, char *aexecString, char *coreName,
+ struct bnode_proc **aproc)
+{
struct bnode_token *tlist, *tt;
afs_int32 code;
struct bnode_proc *tp;
return 0;
}
-int bnode_StopProc(aproc, asignal)
-register struct bnode_proc *aproc;
-int asignal; {
+int bnode_StopProc(register struct bnode_proc *aproc, int asignal)
+{
register int code;
if (!(aproc->flags & BPROC_STARTED) || (aproc->flags & BPROC_EXITED))
return BZNOTACTIVE;
return code;
}
-int bnode_Deactivate(abnode)
-register struct bnode *abnode; {
+int bnode_Deactivate(register struct bnode *abnode)
+{
register struct bnode **pb, *tb;
struct bnode *nb;
if (!(abnode->flags & BNODE_ACTIVE)) return BZNOTACTIVE;
return BZNOENT;
}
-static int DeleteProc(abproc)
-register struct bnode_proc *abproc; {
+static int DeleteProc(register struct bnode_proc *abproc)
+{
register struct bnode_proc **pb, *tb;
struct bnode_proc *nb;
};
/* check whether caller is authorized to manage RX statistics */
-int bozo_rxstat_userok(call)
- struct rx_call *call;
+int bozo_rxstat_userok(struct rx_call *call)
{
return afsconf_SuperUser(bozo_confdir, call, NULL);
}
/* restart bozo process */
-bozo_ReBozo() {
+int bozo_ReBozo()
+{
#ifdef AFS_NT40_ENV
/* exit with restart code; SCM integrator process will restart bosserver */
int status = BOSEXIT_RESTART;
}
/* make sure a dir exists */
-static MakeDir(adir)
-register char *adir; {
+static int MakeDir(register char *adir)
+{
struct stat tstat;
register afs_int32 code;
if (stat(adir, &tstat) < 0 || (tstat.st_mode & S_IFMT) != S_IFDIR) {
}
/* create all the bozo dirs */
-static CreateDirs() {
-
+static int CreateDirs()
+{
MakeDir(AFSDIR_USR_DIRPATH);
MakeDir(AFSDIR_SERVER_AFS_DIRPATH);
MakeDir(AFSDIR_SERVER_BIN_DIRPATH);
}
/* strip the \\n from the end of the line, if it is present */
-static StripLine(abuffer)
-register char *abuffer; {
+static int StripLine(register char *abuffer)
+{
register char *tp;
tp = abuffer + strlen(abuffer); /* starts off pointing at the null */
}
/* write one bnode's worth of entry into the file */
-static bzwrite(abnode, at)
-register struct bnode *abnode;
-register struct bztemp *at; {
+static bzwrite(register struct bnode *abnode, register struct bztemp *at)
+{
register int i;
char tbuffer[BOZO_BSSIZE];
register afs_int32 code;
}
#define MAXPARMS 20
-ReadBozoFile(aname)
-char *aname; {
+int ReadBozoFile(char *aname)
+{
register FILE *tfile;
char tbuffer[BOZO_BSSIZE];
register char *tp;
}
/* write a new bozo file */
-WriteBozoFile(aname)
-char *aname; {
+int WriteBozoFile(char *aname)
+{
register FILE *tfile;
char tbuffer[AFSDIR_PATH_MAX];
register afs_int32 code;
return 0;
}
-static bdrestart(abnode, arock)
-register struct bnode *abnode;
-char *arock; {
+static int bdrestart(register struct bnode *abnode, char *arock)
+{
register afs_int32 code;
if (abnode->fileGoal != BSTAT_NORMAL || abnode->goal != BSTAT_NORMAL)
#define BOZO_MINSKIP 3600 /* minimum to advance clock */
/* lwp to handle system restarts */
-static BozoDaemon() {
+static int BozoDaemon()
+{
register afs_int32 now;
/* now initialize the values */
}
#ifdef AFS_AIX32_ENV
-static tweak_config()
+static int tweak_config()
{
FILE *f;
char c[80];
*/
#ifndef AFS_NT40_ENV
-static void
-background(void)
+static void background(void)
{
/*
* A process is a process group leader if its process ID
#include "AFS_component_version_number.c"
-
-main (argc, argv,envp)
-int argc;
-char **argv;
-char **envp;
+int main (int argc, char **argv, char **envp)
{
struct rx_service *tservice;
register afs_int32 code;
rx_StartServer(1); /* donate this process */
}
-void
-bozo_Log(a,b,c,d,e,f)
-char *a, *b, *c, *d, *e, *f; {
+void bozo_Log(char *a, char *b, char *c, char *d, char *e, char *f)
+{
char tdate[26];
time_t myTime;
char killSent; /* have we tried sigkill signal? */
};
-static int cron_hascore(abnode)
-register struct ezbnode *abnode; {
+static int cron_hascore(register struct ezbnode *abnode) {
char tbuffer[256];
bnode_CoreName(abnode, NULL, tbuffer);
one shot run) or when we should run again. Sleeps until we should run again.
Note that the computation of when we should run again is made in procexit
and/or create procs. This guy only schedules the sleep */
-ScheduleCronBnode(abnode)
-register struct cronbnode *abnode; {
+int ScheduleCronBnode(register struct cronbnode *abnode)
+{
register afs_int32 code;
register afs_int32 temp;
struct bnode_proc *tp;
return 0;
}
-static int cron_restartp (abnode)
-register struct cronbnode *abnode; {
+static int cron_restartp (register struct cronbnode *abnode)
+{
return 0;
}
-static int cron_delete(abnode)
-struct cronbnode *abnode; {
+static int cron_delete(struct cronbnode *abnode)
+{
free(abnode->command);
free(abnode->whenString);
free(abnode);
return 0;
}
-struct bnode *cron_create(ainstance, acommand, awhen)
-char *ainstance;
-char *awhen;
-char *acommand; {
+struct bnode *cron_create(char *ainstance, char *acommand, char *awhen)
+{
struct cronbnode *te;
afs_int32 code;
char *cmdpath;
te = (struct cronbnode *) malloc(sizeof(struct cronbnode));
memset(te, 0, sizeof(struct cronbnode));
code = ktime_ParsePeriodic(awhen, &te->whenToRun);
- if (code < 0) {
+ if ((code < 0) || (bnode_InitBnode(te, &cronbnode_ops, ainstance) != 0)) {
free(te);
free(cmdpath);
return NULL;
}
- bnode_InitBnode(te, &cronbnode_ops, ainstance);
te->when = ktime_next(&te->whenToRun, 0);
te->command = cmdpath;
te->whenString = copystr(awhen);
/* called to SIGKILL a process if it doesn't terminate normally. In cron, also
start up a process if it is time and not already running */
-static int cron_timeout(abnode)
-struct cronbnode *abnode; {
+static int cron_timeout(struct cronbnode *abnode)
+{
register afs_int32 temp;
register afs_int32 code;
struct bnode_proc *tp;
return 0;
}
-static int cron_getstat(abnode, astatus)
-struct cronbnode *abnode;
-afs_int32 *astatus; {
+static int cron_getstat(struct cronbnode *abnode, afs_int32 *astatus)
+{
register afs_int32 temp;
if (abnode->waitingForShutdown) temp = BSTAT_SHUTTINGDOWN;
else if (abnode->b.goal == 0) temp = BSTAT_SHUTDOWN;
return 0;
}
-static int cron_setstat(abnode, astatus)
-register struct cronbnode *abnode;
-afs_int32 astatus; {
-
+static int cron_setstat(register struct cronbnode *abnode, afs_int32 astatus)
+{
if (abnode->waitingForShutdown) return BZBUSY;
if (astatus == BSTAT_SHUTDOWN) {
if (abnode->running) {
return 0;
}
-static int cron_procexit(abnode, aproc)
-struct cronbnode *abnode;
-struct bnode_proc *aproc; {
+static int cron_procexit(struct cronbnode *abnode, struct bnode_proc *aproc)
+{
/* process has exited */
/* log interesting errors for folks */
return 0;
}
-static int cron_getstring(abnode, abuffer, alen)
-struct cronbnode *abnode;
-char *abuffer;
-afs_int32 alen;{
+static int cron_getstring(struct cronbnode *abnode, char *abuffer,
+ afs_int32 alen)
+{
if (abnode->running) strcpy(abuffer, "running now");
else if (abnode->when==0) strcpy(abuffer, "waiting to run once");
else sprintf(abuffer, "run next at %s", ktime_DateOf(abnode->when));
return 0;
}
-static cron_getparm(abnode, aindex, abuffer, alen)
-struct cronbnode *abnode;
-afs_int32 aindex;
-char *abuffer;
-afs_int32 alen; {
+static int cron_getparm(struct cronbnode *abnode, afs_int32 aindex, char *abuffer, afs_int32 alen)
+{
if (aindex == 0) strcpy(abuffer, abnode->command);
else if (aindex == 1) {
strcpy(abuffer, abnode->whenString);
ez_hascore,
};
-static int ez_hascore(abnode)
-register struct ezbnode *abnode; {
+static int ez_hascore(register struct ezbnode *abnode)
+{
char tbuffer[256];
bnode_CoreName(abnode, NULL, tbuffer);
else return 0;
}
-static int ez_restartp (abnode)
-register struct ezbnode *abnode; {
+static int ez_restartp (register struct ezbnode *abnode)
+{
struct bnode_token *tt;
register afs_int32 code;
struct stat tstat;
return code;
}
-static int ez_delete(abnode)
-struct ezbnode *abnode; {
+static int ez_delete(struct ezbnode *abnode)
+{
free(abnode->command);
free(abnode);
return 0;
}
-struct bnode *ez_create(ainstance, acommand)
-char *ainstance;
-char *acommand; {
+struct bnode *ez_create(char *ainstance, char *acommand)
+{
struct ezbnode *te;
char *cmdpath;
te = (struct ezbnode *) malloc(sizeof(struct ezbnode));
memset(te, 0, sizeof(struct ezbnode));
- bnode_InitBnode(te, &ezbnode_ops, ainstance);
+ if (bnode_InitBnode(te, &ezbnode_ops, ainstance) != 0) {
+ free(te);
+ return NULL;
+ }
te->command = cmdpath;
return (struct bnode *) te;
}
/* called to SIGKILL a process if it doesn't terminate normally */
-static int ez_timeout(abnode)
-struct ezbnode *abnode; {
+static int ez_timeout(struct ezbnode *abnode)
+{
if (!abnode->waitingForShutdown) return 0; /* spurious */
/* send kill and turn off timer */
bnode_StopProc(abnode->proc, SIGKILL);
return 0;
}
-static int ez_getstat(abnode, astatus)
-struct ezbnode *abnode;
-afs_int32 *astatus; {
+static int ez_getstat(struct ezbnode *abnode, afs_int32 *astatus)
+{
register afs_int32 temp;
if (abnode->waitingForShutdown) temp = BSTAT_SHUTTINGDOWN;
else if (abnode->running) temp = BSTAT_NORMAL;
return 0;
}
-static int ez_setstat(abnode, astatus)
-register struct ezbnode *abnode;
-afs_int32 astatus; {
+static int ez_setstat(register struct ezbnode *abnode, afs_int32 astatus)
+{
struct bnode_proc *tp;
register afs_int32 code;
return 0;
}
-static int ez_procexit(abnode, aproc)
-struct ezbnode *abnode;
-struct bnode_proc *aproc; {
+static int ez_procexit(struct ezbnode *abnode, struct bnode_proc *aproc)
+{
/* process has exited */
register afs_int32 code;
return code;
}
-static int ez_getstring(abnode, abuffer, alen)
-struct ezbnode *abnode;
-char *abuffer;
-afs_int32 alen;{
+static int ez_getstring(struct ezbnode *abnode, char *abuffer, afs_int32 alen)
+{
return -1; /* don't have much to add */
}
-static ez_getparm(abnode, aindex, abuffer, alen)
-struct ezbnode *abnode;
-afs_int32 aindex;
-char *abuffer;
-afs_int32 alen; {
+static ez_getparm(struct ezbnode *abnode, afs_int32 aindex, char *abuffer, afs_int32 alen)
+{
if (aindex > 0) return BZDOM;
strcpy(abuffer, abnode->command);
return 0;
* there may not be an active process for a bnode that dumped core at the
* time the query is done.
*/
-static int fs_hascore(abnode)
-register struct ezbnode *abnode; {
+static int fs_hascore(register struct ezbnode *abnode)
+{
char tbuffer[256];
/* see if file server has a core file */
return 0;
}
-static int fs_restartp (abnode)
-register struct fsbnode *abnode; {
+static int fs_restartp (register struct fsbnode *abnode)
+{
struct bnode_token *tt;
register afs_int32 code;
struct stat tstat;
/* set needsSalvage flag, creating file SALVAGE.<instancename> if
we need to salvage the file system (so we can tell over panic reboots */
-static SetSalFlag(abnode, aflag)
-register struct fsbnode *abnode;
-register int aflag; {
+static int SetSalFlag(register struct fsbnode *abnode, register int aflag)
+{
char tbuffer[AFSDIR_PATH_MAX];
int fd;
}
/* set the needsSalvage flag according to the existence of the salvage file */
-static RestoreSalFlag(abnode)
-register struct fsbnode *abnode; {
+static int RestoreSalFlag(register struct fsbnode *abnode) {
char tbuffer[AFSDIR_PATH_MAX];
strcompose(tbuffer, AFSDIR_PATH_MAX, AFSDIR_SERVER_LOCAL_DIRPATH, "/", SALFILE,
return 0;
}
-char *copystr(a)
-register char *a; {
+char *copystr(register char *a)
+{
register char *b;
b = (char *) malloc(strlen(a)+1);
strcpy(b, a);
return b;
}
-static int fs_delete(abnode)
-struct fsbnode *abnode; {
+static int fs_delete(struct fsbnode *abnode) {
free(abnode->filecmd);
free(abnode->volcmd);
free(abnode->salcmd);
#endif /* AFS_NT40_ENV */
-struct bnode *fs_create(ainstance, afilecmd, avolcmd, asalcmd, ascancmd)
-char *ainstance;
-char *afilecmd;
-char *avolcmd;
-char *asalcmd;
-char *ascancmd; {
+struct bnode *fs_create(char *ainstance, char *afilecmd, char *avolcmd, char *asalcmd, char *ascancmd)
+{
struct stat tstat;
register struct fsbnode *te;
char cmdname[AFSDIR_PATH_MAX];
te->scancmd = scanCmdpath;
else
te->scancmd = NULL;
- bnode_InitBnode(te, &fsbnode_ops, ainstance);
+ if (bnode_InitBnode(te, &fsbnode_ops, ainstance) != 0) {
+ free(te);
+ free(fileCmdpath); free(volCmdpath); free(salCmdpath);
+ return NULL;
+ }
bnode_SetTimeout(te, POLLTIME); /* ask for timeout activations every 10 seconds */
RestoreSalFlag(te); /* restore needsSalvage flag based on file's existence */
SetNeedsClock(te); /* compute needsClock field */
}
/* called to SIGKILL a process if it doesn't terminate normally */
-static int fs_timeout(abnode)
-struct fsbnode *abnode; {
+static int fs_timeout(struct fsbnode *abnode) {
register afs_int32 now;
now = FT_ApproxTime();
return 0;
}
-static int fs_getstat(abnode, astatus)
-struct fsbnode *abnode;
-afs_int32 *astatus; {
+static int fs_getstat(struct fsbnode *abnode, afs_int32 *astatus)
+{
register afs_int32 temp;
if (abnode->volSDW || abnode->fileSDW || abnode->salSDW || abnode->scanSDW)
temp = BSTAT_SHUTTINGDOWN;
return 0;
}
-static int fs_setstat(abnode, astatus)
-register struct fsbnode *abnode;
-afs_int32 astatus; {
+static int fs_setstat(register struct fsbnode *abnode, afs_int32 astatus)
+{
return NudgeProcs(abnode);
}
-static int fs_procexit(abnode, aproc)
-struct fsbnode *abnode;
-struct bnode_proc *aproc; {
+static int fs_procexit(struct fsbnode *abnode, struct bnode_proc *aproc)
+{
/* process has exited */
if (aproc == abnode->volProc) {
}
/* make sure we're periodically checking the state if we need to */
-static SetNeedsClock(ab)
- register struct fsbnode *ab;
+static int SetNeedsClock(register struct fsbnode *ab)
{
if (ab->b.goal == 1 && ab->fileRunning && ab->volRunning
&& (!ab->scancmd || ab->scanRunning))
if (!ab->needsClock) bnode_SetTimeout(ab, 0);
}
-static NudgeProcs(abnode)
-register struct fsbnode *abnode; {
+static int NudgeProcs(register struct fsbnode *abnode)
+{
struct bnode_proc *tp; /* not register */
register afs_int32 code;
afs_int32 now;
return 0;
}
-static int fs_getstring(abnode, abuffer, alen)
-struct fsbnode *abnode;
-char *abuffer;
-afs_int32 alen;{
+static int fs_getstring(struct fsbnode *abnode, char *abuffer, afs_int32 alen)
+{
if (alen < 40) return -1;
if (abnode->b.goal == 1) {
if (abnode->fileRunning) {
return 0;
}
-static fs_getparm(abnode, aindex, abuffer, alen)
-struct fsbnode *abnode;
-afs_int32 aindex;
-char *abuffer;
-afs_int32 alen; {
+static int fs_getparm(struct fsbnode *abnode, afs_int32 aindex, char *abuffer,
+ afs_int32 alen)
+{
if (aindex == 0)
strcpy(abuffer, abnode->filecmd);
else if (aindex == 1)