/*
- * The Remote User Information Lister 1.9
+ * The Remote User Information Lister
*
- * (c) 1997--2001 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
+ * (c) 1997--2002 Martin Mares <mj@ucw.cz>
*
* This software may be freely distributed and used according to the terms
* of the GNU General Public License. See file COPYING in any of the GNU packages.
#include <fcntl.h>
#include <unistd.h>
#include <dirent.h>
+#include <time.h>
#include <netinet/in.h>
#include <asm/types.h>
#include "net.h"
static int is_uptime;
+static time_t now;
static void
puttime(int s)
{
int i;
+ if (p->server_time - now >= DEFAULT_DOWN_TIME)
+ {
+ printf("%-16s down\n", name);
+ return;
+ }
printf("%-16s up ", name);
puttime(ntohl(p->uptime));
printf(" load");
int m = ntohl(p->num_users);
struct userinfo *i;
+ if (p->server_time - now >= DEFAULT_DOWN_TIME)
+ return;
for(u=0; u<m; u++)
{
i = &p->users[u];
}
if (!is_uptime)
puts("Name Li M Where LogT IdleT");
+ now = time(NULL);
scan();
return 0;
}