aboutsummaryrefslogtreecommitdiff
path: root/status.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2008-08-28 17:45:30 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2008-08-28 17:45:30 +0000
commit33aa9315414dca1218b3c88b0c5ffc89d4379974 (patch)
tree1594150f11001adb185809b5f593ed4be14f3dbe /status.c
parent0abb4ca413d3df152a969d5141622771ddc1f9fa (diff)
downloadrtmux-33aa9315414dca1218b3c88b0c5ffc89d4379974.tar.gz
rtmux-33aa9315414dca1218b3c88b0c5ffc89d4379974.tar.bz2
rtmux-33aa9315414dca1218b3c88b0c5ffc89d4379974.zip
Support OS X by moving to gettimeofday(2) and adding poll compat from OpenSSH.
Diffstat (limited to 'status.c')
-rw-r--r--status.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/status.c b/status.c
index 0c9fc658..7f2ed916 100644
--- a/status.c
+++ b/status.c
@@ -1,4 +1,4 @@
-/* $Id: status.c,v 1.42 2008-06-27 17:32:24 nicm Exp $ */
+/* $Id: status.c,v 1.43 2008-08-28 17:45:27 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -17,10 +17,10 @@
*/
#include <sys/types.h>
+#include <sys/time.h>
#include <stdarg.h>
#include <string.h>
-#include <time.h>
#include "tmux.h"
@@ -40,14 +40,15 @@ status_redraw(struct client *c)
size_t size, start, width;
u_char attr, colr;
struct tm *tm;
+ time_t t;
int larrow, rarrow;
if (c->sy == 0 || !options_get_number(&s->options, "status"))
goto off;
larrow = rarrow = 0;
- if (clock_gettime(CLOCK_REALTIME, &c->status_timer) != 0)
- fatal("clock_gettime failed");
+ if (gettimeofday(&c->status_timer, NULL) != 0)
+ fatal("gettimeofday");
colr = options_get_number(&s->options, "status-bg") +
(options_get_number(&s->options, "status-fg") << 4);
@@ -55,7 +56,8 @@ status_redraw(struct client *c)
if (yy == 0)
goto blank;
- tm = localtime(&(c->status_timer.tv_sec));
+ t = c->status_timer.tv_sec;
+ tm = localtime(&t);
left = options_get_string(&s->options, "status-left");
strftime(lbuf, sizeof lbuf, left, tm);
llen = strlen(lbuf);