summaryrefslogtreecommitdiffstats
path: root/session.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2008-06-03 18:13:54 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2008-06-03 18:13:54 +0000
commit73c9b25d2d0e40a657073489311a4ecd1643362c (patch)
treee7c695728d9c89504d140739422a9c7ef2fde8cc /session.c
parent743956edf898dceff67af785b7bda87cdbd3fdab (diff)
It is too easy to create things in the same second; use a timespec instead.
Diffstat (limited to 'session.c')
-rw-r--r--session.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/session.c b/session.c
index dc2ddce8..4bc52b75 100644
--- a/session.c
+++ b/session.c
@@ -1,4 +1,4 @@
-/* $Id: session.c,v 1.31 2008-06-02 21:08:36 nicm Exp $ */
+/* $Id: session.c,v 1.32 2008-06-03 18:13:54 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -17,10 +17,10 @@
*/
#include <sys/types.h>
+#include <sys/time.h>
#include <string.h>
#include <stdlib.h>
-#include <time.h>
#include <unistd.h>
#include "tmux.h"
@@ -90,7 +90,8 @@ session_create(const char *name, const char *cmd, u_int sx, u_int sy)
u_int i;
s = xmalloc(sizeof *s);
- s->tim = time(NULL);
+ if (clock_gettime(CLOCK_REALTIME, &s->ts) != 0)
+ fatal("clock_gettime");
s->curw = s->lastw = NULL;
RB_INIT(&s->windows);
ARRAY_INIT(&s->bells);