* Makefile.in: new variable PTHREAD_DEFS for portability
authorNathan Bryant <loanshark@uncensored.citadel.org>
Wed, 30 Sep 1998 20:38:21 +0000 (20:38 +0000)
committerNathan Bryant <loanshark@uncensored.citadel.org>
Wed, 30 Sep 1998 20:38:21 +0000 (20:38 +0000)
        * aidepost.c, citadel.c, citmail.c, mailinglist.c, msgform.c,
          netmailer.c, netpoll.c, netproc.c, rcit.c, readlog.c, setup.c,
          stats.c, userlist.c, whobbs.c: return type of main() is int
        * citadel.c, commands.c, messages.c: use time_t properly
        * citserver.c: include <limits.h>

19 files changed:
citadel/ChangeLog
citadel/Makefile.in
citadel/aidepost.c
citadel/citadel.c
citadel/citmail.c
citadel/citserver.c
citadel/commands.c
citadel/mailinglist.c
citadel/messages.c
citadel/msgform.c
citadel/netmailer.c
citadel/netpoll.c
citadel/netproc.c
citadel/rcit.c
citadel/readlog.c
citadel/setup.c
citadel/stats.c
citadel/userlist.c
citadel/whobbs.c

index aab5ff93cca204c4479cf57db22cd5529997e60c..e6dc3c80ddc1a56cd2dfc7c66fbe550d420db0bf 100644 (file)
@@ -1,3 +1,11 @@
+1998-09-30 Nathan Bryant <bryant@cs.usm.maine.edu>
+       * Makefile.in: new variable PTHREAD_DEFS for portability
+       * aidepost.c, citadel.c, citmail.c, mailinglist.c, msgform.c,
+         netmailer.c, netpoll.c, netproc.c, rcit.c, readlog.c, setup.c,
+         stats.c, userlist.c, whobbs.c: return type of main() is int
+       * citadel.c, commands.c, messages.c: use time_t properly
+       * citserver.c: include <limits.h>
+
 Tue Sep 29 23:17:34 EDT 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * room_ops.c: modified usergoto() to look at the new data structures
          for counting new messages and such.
index d59d665a2996b6397c44b4bd7af25363b8f63e8a..edb6612c8d4636d084e6198f3e72e9c1213bbd74 100644 (file)
@@ -24,6 +24,7 @@ CFLAGS=@CFLAGS@ @DEFS@
 CC=@CC@
 SERVER_LFLAGS=@LIBS@
 CURSES=@CURSES@
+PTHREAD_DEFS=-D_REENTRANT
 
 client: $(CLIENT_TARGETS)
 
@@ -90,58 +91,58 @@ citserver: citserver.o user_ops.o support.o room_ops.o file_ops.o \
                $(LFLAGS) $(SERVER_LFLAGS) -o citserver
 
 citserver.o: citserver.c
-       $(CC) $(CFLAGS) -D_REENTRANT -c citserver.c
+       $(CC) $(CFLAGS) $(PTHREAD_DEFS) -c citserver.c
 
 user_ops.o: user_ops.c
-       $(CC) $(CFLAGS) -D_REENTRANT -c user_ops.c
+       $(CC) $(CFLAGS) $(PTHREAD_DEFS) -c user_ops.c
 
 room_ops.o: room_ops.c
-       $(CC) $(CFLAGS) -D_REENTRANT -c room_ops.c
+       $(CC) $(CFLAGS) $(PTHREAD_DEFS) -c room_ops.c
 
 dynloader.o: dynloader.c
-       $(CC) $(CFLAGS) -D_REENTRANT -c dynloader.c
+       $(CC) $(CFLAGS) $(PTHREAD_DEFS) -c dynloader.c
 
 file_ops.o: file_ops.c
-       $(CC) $(CFLAGS) -D_REENTRANT -c file_ops.c
+       $(CC) $(CFLAGS) $(PTHREAD_DEFS) -c file_ops.c
 
 support.o: support.c
-       $(CC) $(CFLAGS) -D_REENTRANT -c support.c
+       $(CC) $(CFLAGS) $(PTHREAD_DEFS) -c support.c
 
 msgbase.o: msgbase.c
-       $(CC) $(CFLAGS) -D_REENTRANT -c msgbase.c
+       $(CC) $(CFLAGS) $(PTHREAD_DEFS) -c msgbase.c
 
 locate_host.o: locate_host.c
-       $(CC) $(CFLAGS) -D_REENTRANT -c locate_host.c
+       $(CC) $(CFLAGS) $(PTHREAD_DEFS) -c locate_host.c
 
 modules/serv_chat.so: serv_chat.o
        $(CC) -shared -o modules/serv_chat.so serv_chat.o
 
 serv_chat.o: serv_chat.c
-       $(CC) $(CFLAGS) -D_REENTRANT -fPIC -c serv_chat.c
+       $(CC) $(CFLAGS) $(PTHREAD_DEFS) -fPIC -c serv_chat.c
 
 modules/serv_test.so: serv_test.o
        $(CC) -shared -o modules/serv_test.so serv_test.o
 
 serv_test.o: serv_test.c
-       $(CC) $(CFLAGS) -D_REENTRANT -fPIC -c serv_test.c
+       $(CC) $(CFLAGS) $(PTHREAD_DEFS) -fPIC -c serv_test.c
 
 housekeeping.o: housekeeping.c
-       $(CC) $(CFLAGS) -D_REENTRANT -c housekeeping.c
+       $(CC) $(CFLAGS) $(PTHREAD_DEFS) -c housekeeping.c
 
 database.o: database.c
-       $(CC) $(CFLAGS) -D_REENTRANT -c database.c
+       $(CC) $(CFLAGS) $(PTHREAD_DEFS) -c database.c
 
 control.o: control.c
-       $(CC) $(CFLAGS) -D_REENTRANT -c control.c
+       $(CC) $(CFLAGS) $(PTHREAD_DEFS) -c control.c
 
 logging.o: logging.c
-       $(CC) $(CFLAGS) -D_REENTRANT -c logging.c
+       $(CC) $(CFLAGS) $(PTHREAD_DEFS) -c logging.c
 
 config.o: config.c
-       $(CC) $(CFLAGS) -D_REENTRANT -c config.c
+       $(CC) $(CFLAGS) $(PTHREAD_DEFS) -c config.c
 
 sysdep.o: sysdep.c
-       $(CC) $(CFLAGS) -D_REENTRANT -c sysdep.c
+       $(CC) $(CFLAGS) $(PTHREAD_DEFS) -c sysdep.c
 
 aidepost: aidepost.o config.o
        $(CC) $(CFLAGS) aidepost.o config.o $(LFLAGS) -o aidepost
index f71a0af8ce49105d3ec79da37561cb34ef64770e..096dacd758e9eab4851d697d544daccadcc9f75c 100644 (file)
@@ -41,7 +41,7 @@ void make_message(char *filename)
        fclose(fp);
        }
 
-void main(int argc, char **argv)
+int main(int argc, char **argv)
 {
        char tempbase[32];
        char temptmp[64];
index 1ff489ee4797c86d179cbead7f261e9f33a714fb..c57f1bfadd472ce8a52abbc2c48acf4b966db989 100644 (file)
@@ -165,7 +165,7 @@ void userlist(void) {
        char buf[256];
        char fl[256];
        struct tm *tmbuf;
-       long lc;
+       time_t lc;
        int linecount = 2;
 
        serv_puts("LIST");
@@ -762,7 +762,7 @@ void who_is_online(int longlist)
                                        flags, extract_int(buf,0), username, roomname);
                                printf("from <%s> using <%s>, idle %ld:%02ld:%02ld\n",
                                        fromhost, clientsoft,
-                                       idlehours, idlemins, idlesecs);
+                                       (long)idlehours, (long)idlemins, (long)idlesecs);
 
                                }
                        else {
@@ -784,7 +784,7 @@ void enternew(char *desc, char *buf, int maxlen)
 /*
  * main
  */
-void main(int argc, char **argv)
+int main(int argc, char **argv)
 {
 int a,b,mcmd;
 int termn8 = 0;
index ac2d5c8ccffb700e2607b50997b68e9025717148..fe2437f365d52438111b0567445d193b41fa07d5 100644 (file)
@@ -508,7 +508,7 @@ void deliver(char recp[], int is_test, int deliver_to_ignet) {
 
 
 
-void main(int argc, char **argv)
+int main(int argc, char **argv)
 {
        int is_test = 0;
        int deliver_to_ignet = 0;
index 5219cdb628aaab8db8d14540e87871db9442cfa3..31aaa68bf9527dced353115e812c8dd7d7dba0b1 100644 (file)
@@ -7,6 +7,7 @@
 #include <ctype.h>
 #include <string.h>
 #include <errno.h>
+#include <limits.h>
 #include <pthread.h>
 #include <syslog.h>
 #include <dlfcn.h>
index 36b63a8f8bf63e489cc75a92c7e03aab44119b6a..59c6232829ed46b1f8896e89fb1decb9ff9e47f7 100644 (file)
@@ -111,8 +111,8 @@ void set_keepalives(int s)
  */
 void do_keepalive(void) {
        char buf[256];
-       static long idlet = 0L;
-       long now;
+       static time_t idlet = 0;
+       time_t now;
 
        time(&now);
        if ((now - idlet) < ((long)S_KEEPALIVE)) return;
@@ -141,7 +141,7 @@ int inkey(void) {           /* get a character from the keyboard, with   */
        int a;          /* the watchdog timer in effect if necessary */
         fd_set rfds;
         struct timeval tv;
-       long start_time, now;
+       time_t start_time, now;
        char inbuf[2];
 
        time(&start_time);
index b8e5572d95f8157201a9519bdfbe2b137a1e86be..807468d51c56db7ef26ccb7c2e7d967e325288a9 100644 (file)
@@ -68,7 +68,7 @@ void xref(char *room, char *listaddr)         /* xref table */
 /*
  * The main loop.  We don't need any command-line parameters to this program.
  */
-void main(void) {
+int main(void) {
 
        char header[3];
        char fields[32][1024];
index 7fe9a01127853ab6b1b6c88440c743837f044cd6..3f42cf95ec5be9f21cbdcd8ae4e9517c9b5e6773 100644 (file)
@@ -191,7 +191,7 @@ void citedit(FILE *fp, long int base_pos)
        struct cittext *ptr;
        char wordbuf[MAXWORDBUF];
        char buf[256];
-       long last_server_msg,now;
+       time_t last_server_msg,now;
 
        /*
         * we're going to keep track of the last time we talked to
@@ -332,7 +332,7 @@ int read_message(long int num, char pagin) /* Read a message from the server */
        char buf[256];
        char m_subject[256];
        char from[256];
-       long now;
+       time_t now;
        struct tm *tm;
        int format_type = 0;
        int fr = 0;
@@ -532,7 +532,8 @@ int make_message(char *filename, char *recipient, int anon_type, int format_type
 { 
        FILE *fp, *atpipe;
        int a,b,e_ex_code;
-       long now,beg;
+       time_t now;
+       long beg;
        char datestr[64];
        int cksum = 0;
        struct AttachedFile *AttachList = NULL;
@@ -665,7 +666,7 @@ MECR2:      b=inkey();
                printf("attach File\n");
                if (strlen(boundary)==0) {
                        sprintf(boundary, "Citadel-Attachment-%ld.%d",
-                               time(NULL), getpid() );
+                               (long)time(NULL), getpid() );
                        }
                newprompt("Filename: ", buf, 68);
                if (access(buf, R_OK)==0) {
index cc3a3b4986ec9b49ccd6ae865ae36f5d75ea9298..efba635cdbf1229658356f8a888958e5ed00d3c3 100644 (file)
@@ -41,7 +41,7 @@ char *strerror(int e)
        }
 #endif
 
-void main(int argc, char **argv)
+int main(int argc, char **argv)
 {
        struct tm *tm;
        int a,b,e,mtype,aflag;
index 47c4d965b49bd081b0529bd9ff000e19b0fef08b..312ae1edc47b2bfcead1632f4077a55bee79051b 100644 (file)
@@ -158,7 +158,7 @@ BONFGM:     b=getc(fp); if (b<0) goto END;
        goto BONFGM;
        }
 
-void main(int argc, char **argv)
+int main(int argc, char **argv)
 {
        int a;
        FILE *fp,*rmail;
index 1bd3b72c2df34b1ed051ae764a40e096ebbc5669..352471dbcaff3f93de9aabb81d04e21802aeb128 100644 (file)
@@ -204,7 +204,7 @@ ABORTUPL:
 
 
 
-void main(int argc, char **argv)
+int main(int argc, char **argv)
 {
        char buf[256];
        char remote_nodename[32];
index 5f18db114cff0e2a4a4798834f3d680a0d1dc6d8..d410f7f66f09b982a86323d87e8156b1b4324158 100644 (file)
@@ -1205,7 +1205,7 @@ void np_attach_to_server(void) {
 /*
  * main
  */
-void main(int argc, char **argv)
+int main(int argc, char **argv)
 {
        char allst[32];
        FILE *allfp;
@@ -1268,5 +1268,6 @@ void main(int argc, char **argv)
        rewrite_syslist();
        printf("netproc: processing ended.\n");
        cleanup(0);
+       return 0;
        }
 
index 6f1ef65a3ba7a60e89c424a57ad4915130d67588..39afbcaedb7cd216731288acb975dc5cdea58ea8 100644 (file)
@@ -68,7 +68,7 @@ GNA:  strcpy(aaa,""); strcpy(bbb,"");
        }
 
 
-void main(int argc, char **argv)
+int main(int argc, char **argv)
 {
        char aaa[128],bbb[128],ccc[128];
        char author[128],recipient[128],room[128],node[128],path[512];
index df90761139e964db8f4864d691faf463752911dd..e7b286ed6016be8baddf51f660b757e2f0773cb5 100644 (file)
@@ -14,7 +14,7 @@
 void get_config (void);
 struct config config;
 
-void 
+int 
 main (int argc, char **argv)
 {
   time_t LogTime;
index 74a9db293ea1e96b2e49b97858689e9de67422d2..80f6b18bf18bbb00e5afc48de58adb4862ca77d5 100644 (file)
@@ -852,7 +852,7 @@ int discover_ui(void) {
 
 
 
-void main(int argc, char *argv[]) {
+int main(int argc, char *argv[]) {
        int a;
        int curr;
        char aaa[128];
@@ -1057,4 +1057,5 @@ NEW_INST:
 
 
        cleanup(0);
+       return 0;
 }
index d3f952846a09fdeb5d5469538540712c88ecc7b4..2692d406402e1da75b3bb1703beb8bf8f18990ba 100644 (file)
@@ -91,7 +91,7 @@ progress (long int curr, long int max)
 
 
 
-void
+int
 main (int argc, char **argv)
 {
   time_t LogTime;
@@ -368,4 +368,5 @@ main (int argc, char **argv)
       exit (0);
  */
     }
+    return 0;
 }
index fd88681bfa2f9cc07ec2ea7b0791dc5976063608..2bf663c05a76376f31d66cce133a7912590a8db0 100644 (file)
@@ -112,7 +112,7 @@ void userlist(void) {
        }
 
 
-void main(int argc, char **argv)
+int main(int argc, char **argv)
 {
        char buf[256];
 
index 9dfa181a9cc1369d32403031f37e5054802a24c8..8da855803cce4aa0254b8dfa1b33eafcfef7d81b 100644 (file)
@@ -66,7 +66,7 @@ void logoff(int code)
        exit(code);
        }
 
-void main(int argc, char **argv)
+int main(int argc, char **argv)
 {
        char buf[256];
        char nodetitle[256];
@@ -119,7 +119,7 @@ void main(int argc, char **argv)
 
        serv_puts("QUIT");
        serv_gets(buf);
-       exit(0);
+       return 0;
        }