summaryrefslogtreecommitdiff
path: root/clients/zaway
diff options
context:
space:
mode:
authorGravatar John F. Carr <jfc@mit.edu>1991-06-20 04:15:29 +0000
committerGravatar John F. Carr <jfc@mit.edu>1991-06-20 04:15:29 +0000
commit07525ddf7b91025c56b7b15d27e3af524c120ddd (patch)
tree34690f232aca1a3f6def09792cc4925167344ff8 /clients/zaway
parent4fb93dad56d5a13bfd1c84ee5094435abff4142d (diff)
POSIX support; add zsub_ prefix where needed.
Diffstat (limited to 'clients/zaway')
-rw-r--r--clients/zaway/zaway.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/clients/zaway/zaway.c b/clients/zaway/zaway.c
index d575da2..67e2656 100644
--- a/clients/zaway/zaway.c
+++ b/clients/zaway/zaway.c
@@ -20,16 +20,20 @@
#include <signal.h>
#ifndef lint
-static char rcsid_zaway_c[] = "$Header$";
-#endif lint
+static 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"
-extern char *getenv(), *malloc();
+#ifdef _POSIX_SOURCE
+#include <stdlib.h>
+#else
+extern char *getenv(), *malloc(), *realloc();
+#endif
extern uid_t getuid();
-#ifdef ULTRIX30
+#if defined(ultrix) || defined(_POSIX_SOURCE)
void cleanup();
#else
int cleanup();
@@ -44,9 +48,10 @@ main(argc,argv)
FILE *fp;
ZNotice_t notice;
ZSubscription_t sub;
- int retval;
+ register int retval;
struct passwd *pw;
- char awayfile[BUFSIZ],*ptr,*msg[2],*envptr;
+ register char *ptr;
+ char awayfile[BUFSIZ],*msg[2],*envptr;
char *find_message();
if ((retval = ZInitialize()) != ZERR_NONE) {
@@ -60,9 +65,9 @@ main(argc,argv)
exit(1);
}
- sub.class = MESSAGE_CLASS;
- sub.classinst = "*";
- sub.recipient = ZGetSender();
+ sub.zsub_class = MESSAGE_CLASS;
+ sub.zsub_classinst = "*";
+ sub.zsub_recipient = ZGetSender();
if (argc > 1)
(void) strcpy(awayfile,argv[1]);
@@ -139,11 +144,11 @@ main(argc,argv)
char *find_message(notice,fp)
ZNotice_t *notice;
- FILE *fp;
+ register FILE *fp;
{
- char bfr[BUFSIZ],*ptr,*ptr2,sender[BUFSIZ];
+ register char *ptr,*ptr2;
+ char bfr[BUFSIZ],sender[BUFSIZ];
int gotone,lastwasnt;
- char *realloc();
rewind(fp);
@@ -187,7 +192,7 @@ char *find_message(notice,fp)
return (ptr);
}
-#ifdef ULTRIX30
+#if defined(ultrix) || defined(_POSIX_SOURCE)
void
#else
int