From 33aa9315414dca1218b3c88b0c5ffc89d4379974 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Thu, 28 Aug 2008 17:45:30 +0000 Subject: Support OS X by moving to gettimeofday(2) and adding poll compat from OpenSSH. --- status.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'status.c') 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 @@ -17,10 +17,10 @@ */ #include +#include #include #include -#include #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); -- cgit