From ac88af748e25a40d062c888396aab8670ff8426a Mon Sep 17 00:00:00 2001 From: Michael Meffie Date: Thu, 6 Oct 2011 08:33:37 -0400 Subject: [PATCH] bozo: build notifier sample program Build the smail-notifier sample program. Change-Id: Ida2fd16e486934c984b2431c95c3a24966b3b2b7 Reviewed-on: http://gerrit.openafs.org/5555 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/bozo/.gitignore | 2 ++ src/bozo/Makefile.in | 10 ++++++++-- src/bozo/smail-notifier.c | 33 +++++---------------------------- src/bozo/test/Makefile.in | 7 ++----- 4 files changed, 17 insertions(+), 35 deletions(-) diff --git a/src/bozo/.gitignore b/src/bozo/.gitignore index 515ed0c2f..9d9c80095 100644 --- a/src/bozo/.gitignore +++ b/src/bozo/.gitignore @@ -8,3 +8,5 @@ /boserr.c /bosint.h /bosserver +/smail-notifier +/test/testproc diff --git a/src/bozo/Makefile.in b/src/bozo/Makefile.in index d9e326c91..69ec46cde 100644 --- a/src/bozo/Makefile.in +++ b/src/bozo/Makefile.in @@ -43,7 +43,8 @@ LIBS= ${TOP_LIBDIR}/librx.a \ OBJS=bosserver.o bnode.o ezbnodeops.o fsbnodeops.o bosint.ss.o bosint.xdr.o \ bosoprocs.o cronbnodeops.o -all: bosserver ${TOP_INCDIR}/afs/bosint.h bos ${TOP_LIBDIR}/libbos.a bos_util +all: bosserver ${TOP_INCDIR}/afs/bosint.h bos ${TOP_LIBDIR}/libbos.a bos_util \ + smail-notifier generated: bosint.ss.c bosint.xdr.c bosint.cs.c bosint.h bnode.h boserr.c @@ -115,6 +116,11 @@ bosserver: $(OBJS) $(LIBS) $(AFS_LDRULE) $(OBJS) ${TOP_LIBDIR}/libaudit.a \ $(LIBS) $(LIB_roken) $(LIB_crypt) ${XLIBS} +smail-notifier.o: smail-notifier.c ${INCLS} + +smail-notifier: smail-notifier.o $(LIBS) + $(AFS_LDRULE) smail-notifier.o $(LIBS) $(LIB_roken) ${XLIBS} + # # Install targets # @@ -149,7 +155,7 @@ dest: bosserver bos bos_util libbos.a bosint.h bnode.h # Misc. targets # clean: - $(RM) -f *.a *.o bos bosserver testproc bos_util \ + $(RM) -f *.a *.o bos bosserver smail-notifier bos_util \ bosint.cs.c bosint.ss.c bosint.xdr.c bosint.h \ core boserr.c bnode.h AFS_component_version_number.c diff --git a/src/bozo/smail-notifier.c b/src/bozo/smail-notifier.c index 4f8da1f32..ae811af74 100644 --- a/src/bozo/smail-notifier.c +++ b/src/bozo/smail-notifier.c @@ -26,16 +26,15 @@ #include "AFS_component_version_number.c" -main(argc, argv) - int argc; - char **argv; +int +main(int argc, char **argv) { struct stat tstat; FILE *fin = stdin; char buf[BUFSIZ], *bufp, *bufp1, *typep, *cmd, *bp; - afs_int32 code, c, fd, id, pflags = -1, len, core = 0, lastE = 0; - char comLine[60], coreName[40], name[40], lastErrorName[50]; - afs_int32 pid = -1, lastExit = -1, lastSignal = -1, rsCount = -1; + afs_int32 code, c, fd, pflags = -1, len, core = 0; + char comLine[60], coreName[40], name[40]; + afs_int32 pid = -1, rsCount = -1; afs_int32 procStarts = -1; afs_int32 errorCode = -1, errorSignal = -1, goal = -1; time_t procStartTime = -1, rsTime = -1, lastAnyExit = -1, lastErrorExit = -1; @@ -62,12 +61,6 @@ main(argc, argv) strcpy(coreName, cmd); else if (!strcmp(typep, "pid:")) pid = atoi(cmd); -#ifdef notdef - else if (!strcmp(typep, "lastExit:")) - lastExit = atoi(cmd); - else if (!strcmp(typep, "lastSignal:")) - lastSignal = atoi(cmd); -#endif else if (!strcmp(typep, "flags:")) pflags = atoi(cmd); else if (!strcmp(typep, "END")) { @@ -165,12 +158,6 @@ main(argc, argv) (core ? (c ? "a recent " : "an 'old' ") : "no "), (core ? bp : "")); bufp += strlen(bufp); -#ifdef notdef - (void)sprintf(bufp, "Last Exit code %d\n", lastExit); - bufp += strlen(bufp); - (void)sprintf(bufp, "Last Signal number %d\n", lastSignal); - bufp += strlen(bufp); -#endif if (pflags == 1) strcpy(bp, "PROCESS STARTED"); else if (pflags == 2) @@ -210,16 +197,6 @@ main(argc, argv) bufp += strlen(bufp); (void)sprintf(bufp, "Last process terminating signal %d\n", errorSignal); bufp += strlen(bufp); -#ifdef notdef - if (strcmp(lastErrorName, "(null)")) - lastE = 1; - if (lastE) { - (void)sprintf(bufp, - "Short name of process that failed last in this bnode is: %s\n", - lastErrorName); - bufp += strlen(bufp); - } -#endif (void)sprintf(bufp, "The server is now %srunning\n", (goal ? "" : "not ")); bufp += strlen(bufp); diff --git a/src/bozo/test/Makefile.in b/src/bozo/test/Makefile.in index 203e20193..f813ccd49 100644 --- a/src/bozo/test/Makefile.in +++ b/src/bozo/test/Makefile.in @@ -10,7 +10,7 @@ include @TOP_OBJDIR@/src/config/Makefile.config MODULE_CFLAGS=$(LDIRS) $(LIBS) -all: testproc smail-notifier +all: testproc install: @@ -20,14 +20,11 @@ install: testproc: testproc.c $(CC) $(AFS_LDFLAGS) $(AFS_CFLAGS) -o testproc testproc.c -smail-notifier: smail-notifier.c - $(CC) $(AFS_LDFLAGS) $(AFS_CFLAGS) -o smail-notifier smail-notifier.c - # # Misc targets # clean: - $(RM) -f *.a *.o testproc smail-notifier core + $(RM) -f *.a *.o testproc core dest: -- 2.39.5