]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_rwho.c
fix all the <time.h> vs. <sys/time.h> issues, hopefully
[citadel.git] / citadel / serv_rwho.c
index a58380f7faf842f9caeb3907ffe3fbffd9ca959f..582e1fd5b25c57affae687bac550a7fae02f469d 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"
@@ -96,11 +106,13 @@ void cmd_rwho(char *argbuf) {
                        strcpy(room, real_room);
                }
                
-                if ((aide) && (spoofed))
-                   strcat(flags, "+");
+                if ((aide) && (spoofed)) {
+                       strcat(flags, "+");
+               }
                
-               if ((cptr->cs_flags & CS_STEALTH) && (aide))
-                  strcat(flags, "-");
+               if ((cptr->cs_flags & CS_STEALTH) && (aide)) {
+                       strcat(flags, "-");
+               }
                
                if (((cptr->cs_flags&CS_STEALTH)==0) || (aide))
                {
@@ -109,31 +121,30 @@ void cmd_rwho(char *argbuf) {
                                host, cptr->cs_clientname,
                                (long)(cptr->lastidle),
                                cptr->lastcmdname, flags);
-               }
-
-               if ((user_spoofed) && (aide)) {
-                       cprintf("%s|", cptr->curr_user);
-               }
-               else {
-                       cprintf("|");
-               }
-
-               if ((room_spoofed) && (aide)) {
-                       cprintf("%s|", real_room);
-               }
-               else {
-                       cprintf("|");
-               }
 
-               if ((host_spoofed) && (aide)) {
-                       cprintf("%s|", cptr->cs_host);
-               }
-               else {
-                       cprintf("|");
+                       if ((user_spoofed) && (aide)) {
+                               cprintf("%s|", cptr->curr_user);
+                       }
+                       else {
+                               cprintf("|");
+                       }
+       
+                       if ((room_spoofed) && (aide)) {
+                               cprintf("%s|", real_room);
+                       }
+                       else {
+                               cprintf("|");
+                       }
+       
+                       if ((host_spoofed) && (aide)) {
+                               cprintf("%s|", cptr->cs_host);
+                       }
+                       else {
+                               cprintf("|");
+                       }
+       
+                       cprintf("\n");
                }
-
-               cprintf("\n");
-
        }
 
        /* Now it's magic time.  Before we finish, call any EVT_RWHO hooks