diff options
author | Greg Hudson <ghudson@mit.edu> | 1997-09-14 17:50:06 +0000 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 1997-09-14 17:50:06 +0000 |
commit | ac16f380e349fa39ec7e26bccb5456cb300006a5 (patch) | |
tree | c07ca88af97b4f6b77d28a2dc723d2e4621ed302 /clients/zaway | |
parent | d33e482744fad80d95cdd89ed380c5b8401e49bf (diff) |
Pull in sources from zephyr locker. See /mit/zephyr/repository for
detailed change information.
Diffstat (limited to 'clients/zaway')
-rw-r--r-- | clients/zaway/Imakefile | 15 | ||||
-rw-r--r-- | clients/zaway/Makefile.in | 47 | ||||
-rw-r--r-- | clients/zaway/zaway.c | 29 |
3 files changed, 56 insertions, 35 deletions
diff --git a/clients/zaway/Imakefile b/clients/zaway/Imakefile deleted file mode 100644 index aabe953..0000000 --- a/clients/zaway/Imakefile +++ /dev/null @@ -1,15 +0,0 @@ -/**/# Copyright 1988 Massachusetts Institute of Technology. -/**/# -/**/# For copying and distribution information, see the file -/**/# "mit-copyright.h". -/**/# -/**/# $Source$ -/**/# $Author$ -/**/# $Header$ -/**/# - -SRCS = zaway.c -OBJS = zaway.o - -zprogram(zaway,) -install_man(zaway.1,zaway.1) diff --git a/clients/zaway/Makefile.in b/clients/zaway/Makefile.in new file mode 100644 index 0000000..64db77d --- /dev/null +++ b/clients/zaway/Makefile.in @@ -0,0 +1,47 @@ +SHELL = /bin/sh + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +datadir=@datadir@ +confdir=@confdir@ +sbindir=@sbindir@ +lsbindir=@lsbindir@ + +includedir=${prefix}/include +mandir=${prefix}/man +libdir=${exec_prefix}/lib +bindir=${exec_prefix}/bin + +srcdir=@srcdir@ +top_srcdir=@top_srcdir@ +BUILDTOP=../.. +VPATH=@srcdir@ +CC=@CC@ +INSTALL=@INSTALL@ + +DEBUG=-O +CFLAGS=${DEBUG} -I${top_srcdir}/h -I${BUILDTOP}/h @CPPFLAGS@ +LDFLAGS=${DEBUG} -L${BUILDTOP}/lib/zephyr @ET_LDFLAGS@ @LDFLAGS@ +LIBS=-lzephyr @LIBS@ -lcom_err + +OBJS= zaway.o + +all: zaway + +zaway: ${OBJS} ${BUILDTOP}/lib/zephyr/libzephyr.a @ETDEP@ + ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS} + +check: + +install: zaway + ${INSTALL} -m 755 -s zaway ${bindir} + ${INSTALL} -m 644 ${srcdir}/zaway.1 ${mandir}/man1 + +clean: + rm -f ${OBJS} zaway + +${OBJS}: ${top_srcdir}/h/sysdep.h ${BUILDTOP}/h/config.h +${OBJS}: ${BUILDTOP}/h/zephyr/zephyr.h ${BUILDTOP}/h/zephyr/zephyr_err.h + +.PHONY: all check install clean + diff --git a/clients/zaway/zaway.c b/clients/zaway/zaway.c index 8da42c9..5dfdc8d 100644 --- a/clients/zaway/zaway.c +++ b/clients/zaway/zaway.c @@ -11,34 +11,23 @@ * "mit-copyright.h". */ +#include <sysdep.h> #include <zephyr/mit-copyright.h> - #include <zephyr/zephyr.h> - #include <pwd.h> -#include <string.h> -#include <signal.h> +#include <com_err.h> #ifndef lint -static char rcsid_zaway_c[] = "$Id$"; +static const char rcsid_zaway_c[] = "$Id$"; #endif #define MESSAGE_CLASS "MESSAGE" #define DEFAULT_MSG "I'm sorry, but I am currently away from the terminal and am\nnot able to receive your message.\n" -#ifdef POSIX -#include <stdlib.h> -#define SIGNAL_RETURN_TYPE void -#else -extern char *getenv(), *malloc(), *realloc(); -extern uid_t getuid(); -#define SIGNAL_RETURN_TYPE int -#endif - -SIGNAL_RETURN_TYPE cleanup(); +RETSIGTYPE cleanup(); u_short port; -main(argc,argv) +int main(argc,argv) int argc; char *argv[]; { @@ -50,7 +39,7 @@ main(argc,argv) register char *ptr; char awayfile[BUFSIZ],*msg[2],*envptr; char *find_message(); -#ifdef POSIX +#ifdef _POSIX_VERSION struct sigaction sa; #endif @@ -89,7 +78,7 @@ main(argc,argv) fprintf(stderr,"File %s not found!\n",awayfile); exit(1); } -#ifdef POSIX +#ifdef _POSIX_VERSION (void) sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sa.sa_handler = cleanup; @@ -101,7 +90,7 @@ main(argc,argv) (void) signal(SIGTERM, cleanup); (void) signal(SIGHUP, cleanup); #endif - if ((retval = ZSubscribeTo(&sub,1,port)) != ZERR_NONE) { + if ((retval = ZSubscribeToSansDefaults(&sub,1,port)) != ZERR_NONE) { com_err(argv[0],retval,"while subscribing"); exit(1); } @@ -199,7 +188,7 @@ char *find_message(notice,fp) return (ptr); } -SIGNAL_RETURN_TYPE cleanup() +RETSIGTYPE cleanup() { ZCancelSubscriptions(port); exit(1); |