* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
- * Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
+ * Copyright (c) 2005-2010 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*
}
}
}
-static void tty_user_time(char *ptr, char *tty, char times_in_seconds)
+static void tty_user_time(char *ptr, char *tty)
{
time_t real, diff, log_in;
char buf[BUFLEN] = "";
time(&real);
diff = difftime(real, log_in);
- if(times_in_seconds) {
- snprintf(buf, BUFLEN, "%d", (int) diff);
- } else {
- format_seconds(buf, BUFLEN, diff);
- }
+ format_seconds(buf, BUFLEN, diff);
strncpy(ptr, buf, BUFLEN-1);
}
}
}
-void update_user_time(char *tty, char times_in_seconds)
+void update_user_time(char *tty)
{
struct information *current_info = &info;
char temp[BUFLEN] = "";
current_info->users.ctime = malloc(text_buffer_size);
}
- tty_user_time(temp, tty, times_in_seconds);
+ tty_user_time(temp, tty);
if (temp != NULL) {
if (current_info->users.ctime) {
}
}
-void update_users(void)
+int update_users(void)
{
struct information *current_info = &info;
char temp[BUFLEN] = "";
current_info->users.times = malloc(text_buffer_size);
strncpy(current_info->users.times, "broken", text_buffer_size);
}
+ return 0;
}