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/zlocate | |
parent | d33e482744fad80d95cdd89ed380c5b8401e49bf (diff) |
Pull in sources from zephyr locker. See /mit/zephyr/repository for
detailed change information.
Diffstat (limited to 'clients/zlocate')
-rw-r--r-- | clients/zlocate/Imakefile | 15 | ||||
-rw-r--r-- | clients/zlocate/Makefile.in | 47 | ||||
-rw-r--r-- | clients/zlocate/zlocate.c | 22 |
3 files changed, 58 insertions, 26 deletions
diff --git a/clients/zlocate/Imakefile b/clients/zlocate/Imakefile deleted file mode 100644 index 291d74a..0000000 --- a/clients/zlocate/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 = zlocate.c -OBJS = zlocate.o - -zprogram(zlocate,) -install_man(zlocate.1,zlocate.1) diff --git a/clients/zlocate/Makefile.in b/clients/zlocate/Makefile.in new file mode 100644 index 0000000..403578d --- /dev/null +++ b/clients/zlocate/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=-g +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= zlocate.o + +all: zlocate + +zlocate: ${OBJS} ${BUILDTOP}/lib/zephyr/libzephyr.a @ETDEP@ + ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS} + +check: + +install: zlocate + ${INSTALL} -m 755 -s zlocate ${DESTDIR}${bindir} + ${INSTALL} -m 644 ${srcdir}/zlocate.1 ${DESTDIR}${mandir}/man1 + +clean: + rm -f ${OBJS} zlocate + +${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/zlocate/zlocate.c b/clients/zlocate/zlocate.c index c117cb6..6167896 100644 --- a/clients/zlocate/zlocate.c +++ b/clients/zlocate/zlocate.c @@ -11,21 +11,18 @@ * "mit-copyright.h". */ -#include <zephyr/zephyr_internal.h> -#include <signal.h> +#include <sysdep.h> +#include <zephyr/zephyr.h> #include <sys/socket.h> #if !defined(lint) && !defined(SABER) -static char rcsid_zlocate_c[] = "$Id$"; +static const char rcsid_zlocate_c[] = "$Id$"; #endif int numusers=0, numleft=0, parallel=0, oneline=0; char *whoami; -#ifdef POSIX -void -#endif -timeout(sig) +RETSIGTYPE timeout(sig) { fprintf (stderr, "%s: no response from server\n", whoami); exit(1); @@ -75,9 +72,9 @@ main(argc,argv) { char user[BUFSIZ],*whichuser; ZAsyncLocateData_t ald; - int retval,i,numlocs,loc,auth; + int retval,i,numlocs,numfound,loc,auth; ZNotice_t notice; -#ifdef POSIX +#ifdef _POSIX_VERSION struct sigaction sa; #endif @@ -122,6 +119,7 @@ main(argc,argv) } numleft = numusers; + numfound = 0; i = 0; for (loc = 0; loc < argc; loc++) { @@ -145,11 +143,12 @@ main(argc,argv) exit(1); } print_locs(user,numlocs); + numfound += numlocs; } } if (parallel) { -#ifdef POSIX +#ifdef _POSIX_VERSION sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sa.sa_handler = timeout; @@ -171,9 +170,10 @@ main(argc,argv) if (numlocs >= 0) { print_locs(whichuser,numlocs); free(whichuser); + numfound += numlocs; } ZFreeNotice(¬ice); } } - return(0); + return((numfound > 0) ? 0 : 1); } |