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/zleave | |
parent | d33e482744fad80d95cdd89ed380c5b8401e49bf (diff) |
Pull in sources from zephyr locker. See /mit/zephyr/repository for
detailed change information.
Diffstat (limited to 'clients/zleave')
-rw-r--r-- | clients/zleave/Imakefile | 15 | ||||
-rw-r--r-- | clients/zleave/Makefile.in | 47 | ||||
-rw-r--r-- | clients/zleave/zleave.c | 25 |
3 files changed, 56 insertions, 31 deletions
diff --git a/clients/zleave/Imakefile b/clients/zleave/Imakefile deleted file mode 100644 index aae9ed2..0000000 --- a/clients/zleave/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$ -/**/# $Id$ -/**/# - -SRCS = zleave.c -OBJS = zleave.o - -zprogram(zleave,) -install_man(zleave.1,zleave.1) diff --git a/clients/zleave/Makefile.in b/clients/zleave/Makefile.in new file mode 100644 index 0000000..367ce8d --- /dev/null +++ b/clients/zleave/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= zleave.o + +all: zleave + +zleave: ${OBJS} ${BUILDTOP}/lib/zephyr/libzephyr.a @ETDEP@ + ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS} + +check: + +install: zleave + ${INSTALL} -m 755 -s zleave ${DESTDIR}${bindir} + ${INSTALL} -m 644 ${srcdir}/zleave.1 ${DESTDIR}${mandir}/man1 + +clean: + rm -f ${OBJS} zleave + +${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/zleave/zleave.c b/clients/zleave/zleave.c index 778f3e2..2484f6a 100644 --- a/clients/zleave/zleave.c +++ b/clients/zleave/zleave.c @@ -11,8 +11,8 @@ * "mit-copyright.h". */ +#include <sysdep.h> #include <zephyr/mit-copyright.h> - #include <zephyr/zephyr.h> #ifndef lint @@ -37,15 +37,6 @@ char copyright[] = All rights reserved.\n"; #endif /* not lint */ -#ifndef lint -static char sccsid[] = "@(#)leave.c 5.2 (Berkeley) 12/2/87"; -#endif /* not lint */ - -#include <stdio.h> -#include <ctype.h> -#include <signal.h> -#include <string.h> - #define MESSAGE_CLASS "MESSAGE" #define INSTANCE "LEAVE" /* @@ -69,7 +60,8 @@ int use_zephyr=1, oldpid; main(argc, argv) char **argv; { - long when, now, diff, hours, minutes; + time_t now; + long when, diff, hours, minutes; char *cp; FILE *fp; struct tm *nv; @@ -93,7 +85,8 @@ char **argv; sub.zsub_class = MESSAGE_CLASS; sub.zsub_classinst = INSTANCE; sub.zsub_recipient = ZGetSender(); - if (ZSubscribeTo(&sub,1,(u_short)port) != ZERR_NONE) { + if (ZSubscribeToSansDefaults(&sub,1,(u_short)port) + != ZERR_NONE) { fprintf(stderr, "Subscription error! Writing to your terminal...\n"); use_zephyr = 0; @@ -212,13 +205,13 @@ int *hp, *mp; doalarm(nmins) long nmins; { + time_t daytime; char *msg1, *msg2, *msg3, *msg4; register int i; long slp1, slp2, slp3, slp4; long seconds, gseconds; - long daytime; FILE *fp; -#ifdef POSIX +#ifdef _POSIX_VERSION struct sigaction sa; #endif @@ -282,7 +275,7 @@ long nmins; (void) perror("fclose on pid file"); } -#ifdef POSIX +#ifdef _POSIX_VERSION sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sa.sa_handler = SIG_IGN; @@ -407,7 +400,7 @@ long secs; } } -#ifdef V6 +#ifndef HAVE_GETLOGIN char *getlogin() { #include <utmp.h> |