]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_bio.c
fix all the <time.h> vs. <sys/time.h> issues, hopefully
[citadel.git] / citadel / serv_bio.c
index 513d0b3c396b9a5a161ae61f0a7659208849535a..7915bbfb5d367f255b7ddd0487a08e1057ec1963 100644 (file)
 #include <pwd.h>
 #include <errno.h>
 #include <sys/types.h>
-#include <sys/time.h>
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+
 #include <sys/wait.h>
 #include <string.h>
 #include <limits.h>
 #include "citadel.h"
 #include "server.h"
-#include <time.h>
 #include "sysdep_decls.h"
 #include "citserver.h"
 #include "support.h"
@@ -42,8 +52,7 @@
  * enter user bio
  */
 void cmd_ebio(char *cmdbuf) {
-       char cbuf[SIZ];
-       char *ibuf;
+       char buf[SIZ];
        FILE *fp;
 
        if (!(CC->logged_in)) {
@@ -51,15 +60,15 @@ void cmd_ebio(char *cmdbuf) {
                return;
        }
 
-       sprintf(cbuf,"./bio/%ld",CC->usersupp.usernum);
-       fp = fopen(cbuf,"w");
+       sprintf(buf,"./bio/%ld",CC->usersupp.usernum);
+       fp = fopen(buf,"w");
        if (fp == NULL) {
                cprintf("%d Cannot create file\n",ERROR);
                return;
        }
        cprintf("%d  \n",SEND_LISTING);
-       while(client_gets(&ibuf), strcmp(ibuf,"000")) {
-               fprintf(fp,"%s\n",ibuf);
+       while(client_gets(buf), strcmp(buf,"000")) {
+               fprintf(fp,"%s\n",buf);
        }
        fclose(fp);
 }