ANSI fixes (one real bug!)
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Wed, 27 Feb 1991 03:40:17 +0000 (19:40 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Wed, 27 Feb 1991 03:40:17 +0000 (19:40 -0800)
SCCS-vsn: libexec/talkd/announce.c 5.9
SCCS-vsn: libexec/talkd/print.c 5.8
SCCS-vsn: libexec/talkd/process.c 5.10
SCCS-vsn: libexec/talkd/table.c 5.7
SCCS-vsn: libexec/talkd/talkd.c 5.8

usr/src/libexec/talkd/announce.c
usr/src/libexec/talkd/print.c
usr/src/libexec/talkd/process.c
usr/src/libexec/talkd/table.c
usr/src/libexec/talkd/talkd.c

index b607a7b..39573c2 100644 (file)
@@ -6,24 +6,24 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)announce.c 5.8 (Berkeley) %G%";
+static char sccsid[] = "@(#)announce.c 5.9 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #include <sys/stat.h>
 #endif /* not lint */
 
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sgtty.h>
-#include <sys/ioctl.h>
 #include <sys/time.h>
 #include <sys/time.h>
-#include <stdio.h>
 #include <sys/wait.h>
 #include <sys/wait.h>
+#include <sys/socket.h>
+#include <protocols/talkd.h>
+#include <sgtty.h>
 #include <errno.h>
 #include <syslog.h>
 #include <errno.h>
 #include <syslog.h>
-
-#include <protocols/talkd.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
 #include <paths.h>
 
 #include <paths.h>
 
-extern int errno;
-extern char hostname[];
+extern char hostname[];
 
 /*
  * Announce an invitation to talk.
 
 /*
  * Announce an invitation to talk.
index 74cfef8..25c5f3d 100644 (file)
@@ -6,16 +6,16 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)print.c    5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)print.c    5.8 (Berkeley) %G%";
 #endif /* not lint */
 
 /* debug print routines */
 
 #endif /* not lint */
 
 /* debug print routines */
 
-#include <stdio.h>
-#include <syslog.h>
-#include <sys/param.h>
-
+#include <sys/types.h>
+#include <sys/socket.h>
 #include <protocols/talkd.h>
 #include <protocols/talkd.h>
+#include <syslog.h>
+#include <stdio.h>
 
 static char *types[] =
     { "leave_invite", "look_up", "delete", "announce" };
 
 static char *types[] =
     { "leave_invite", "look_up", "delete", "announce" };
index 810d863..240c829 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)process.c  5.9 (Berkeley) %G%";
+static char sccsid[] = "@(#)process.c  5.10 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -17,17 +17,17 @@ static char sccsid[] = "@(#)process.c       5.9 (Berkeley) %G%";
  *               in the table for the local user
  *     DELETE - delete invitation
  */
  *               in the table for the local user
  *     DELETE - delete invitation
  */
-#include <sys/types.h>
+#include <sys/param.h>
 #include <sys/stat.h>
 #include <sys/stat.h>
-#include <stdio.h>
-#include <syslog.h>
-#include <netdb.h>
+#include <sys/socket.h>
 #include <netinet/in.h>
 #include <netinet/in.h>
-
 #include <protocols/talkd.h>
 #include <protocols/talkd.h>
+#include <netdb.h>
+#include <syslog.h>
+#include <stdio.h>
+#include <string.h>
 #include <paths.h>
 
 #include <paths.h>
 
-char   *strcpy();
 CTL_MSG *find_request();
 CTL_MSG *find_match();
 
 CTL_MSG *find_request();
 CTL_MSG *find_match();
 
@@ -117,7 +117,7 @@ do_announce(mp, rp)
                return;
        }
 #define        satosin(sa)     ((struct sockaddr_in *)(sa))
                return;
        }
 #define        satosin(sa)     ((struct sockaddr_in *)(sa))
-       hp = gethostbyaddr(&satosin(&mp->ctl_addr)->sin_addr,
+       hp = gethostbyaddr((char *)&satosin(&mp->ctl_addr)->sin_addr,
                sizeof (struct in_addr), AF_INET);
        if (hp == (struct hostent *)0) {
                rp->answer = MACHINE_UNKNOWN;
                sizeof (struct in_addr), AF_INET);
        if (hp == (struct hostent *)0) {
                rp->answer = MACHINE_UNKNOWN;
index fcd67b7..e2c8e91 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)table.c    5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)table.c    5.7 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -17,12 +17,15 @@ static char sccsid[] = "@(#)table.c 5.6 (Berkeley) %G%";
  *
  * Consider this a mis-guided attempt at modularity
  */
  *
  * Consider this a mis-guided attempt at modularity
  */
-#include <stdio.h>
-#include <sys/time.h>
-#include <syslog.h>
 #include <sys/param.h>
 #include <sys/param.h>
-
+#include <sys/time.h>
+#include <sys/socket.h>
 #include <protocols/talkd.h>
 #include <protocols/talkd.h>
+#include <syslog.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
 #define MAX_ID 16000   /* << 2^15 so I don't have sign troubles */
 
 
 #define MAX_ID 16000   /* << 2^15 so I don't have sign troubles */
 
@@ -30,7 +33,7 @@ static char sccsid[] = "@(#)table.c   5.6 (Berkeley) %G%";
 
 extern int debug;
 struct timeval tp;
 
 extern int debug;
 struct timeval tp;
-struct timezone *txp;
+struct timezone txp;
 
 typedef struct table_entry TABLE_ENTRY;
 
 
 typedef struct table_entry TABLE_ENTRY;
 
@@ -44,7 +47,6 @@ struct table_entry {
 TABLE_ENTRY *table = NIL;
 CTL_MSG *find_request();
 CTL_MSG *find_match();
 TABLE_ENTRY *table = NIL;
 CTL_MSG *find_request();
 CTL_MSG *find_match();
-char   *malloc();
 
 /*
  * Look in the table for an invitation that matches the current
 
 /*
  * Look in the table for an invitation that matches the current
@@ -55,7 +57,7 @@ find_match(request)
        register CTL_MSG *request;
 {
        register TABLE_ENTRY *ptr;
        register CTL_MSG *request;
 {
        register TABLE_ENTRY *ptr;
-       long current_time;
+       time_t current_time;
 
        gettimeofday(&tp, &txp);
        current_time = tp.tv_sec;
 
        gettimeofday(&tp, &txp);
        current_time = tp.tv_sec;
@@ -89,7 +91,7 @@ find_request(request)
        register CTL_MSG *request;
 {
        register TABLE_ENTRY *ptr;
        register CTL_MSG *request;
 {
        register TABLE_ENTRY *ptr;
-       long current_time;
+       time_t current_time;
 
        gettimeofday(&tp, &txp);
        current_time = tp.tv_sec;
 
        gettimeofday(&tp, &txp);
        current_time = tp.tv_sec;
@@ -127,7 +129,7 @@ insert_table(request, response)
        CTL_RESPONSE *response;
 {
        register TABLE_ENTRY *ptr;
        CTL_RESPONSE *response;
 {
        register TABLE_ENTRY *ptr;
-       long current_time;
+       time_t current_time;
 
        gettimeofday(&tp, &txp);
        current_time = tp.tv_sec;
 
        gettimeofday(&tp, &txp);
        current_time = tp.tv_sec;
index 5f0d02f..d3b63ee 100644 (file)
@@ -12,7 +12,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)talkd.c    5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)talkd.c    5.8 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -21,12 +21,17 @@ static char sccsid[] = "@(#)talkd.c 5.7 (Berkeley) %G%";
  * disconnect all descriptors and ttys, and then endless
  * loop on waiting for and processing requests
  */
  * disconnect all descriptors and ttys, and then endless
  * loop on waiting for and processing requests
  */
-#include <stdio.h>
-#include <errno.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <protocols/talkd.h>
 #include <signal.h>
 #include <syslog.h>
 #include <signal.h>
 #include <syslog.h>
-
-#include <protocols/talkd.h>
+#include <time.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <paths.h>
 
 CTL_MSG                request;
 #include <paths.h>
 
 CTL_MSG                request;
@@ -34,7 +39,7 @@ CTL_RESPONSE  response;
 
 int    sockt;
 int    debug = 0;
 
 int    sockt;
 int    debug = 0;
-int    timeout();
+void   timeout();
 long   lastmsgtime;
 
 char   hostname[32];
 long   lastmsgtime;
 
 char   hostname[32];
@@ -86,6 +91,7 @@ main(argc, argv)
        }
 }
 
        }
 }
 
+void
 timeout()
 {
 
 timeout()
 {