Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam 2015-11-18 10:01:11 +00:00
commit 4b703d3049

View File

@ -130,10 +130,6 @@ session_create(const char *name, int argc, char **argv, const char *path,
memcpy(s->tio, tio, sizeof *s->tio); memcpy(s->tio, tio, sizeof *s->tio);
} }
if (gettimeofday(&s->creation_time, NULL) != 0)
fatal("gettimeofday failed");
session_update_activity(s, &s->creation_time);
s->sx = sx; s->sx = sx;
s->sy = sy; s->sy = sy;
@ -150,6 +146,8 @@ session_create(const char *name, int argc, char **argv, const char *path,
} }
RB_INSERT(sessions, &sessions, s); RB_INSERT(sessions, &sessions, s);
log_debug("new session %s $%u", s->name, s->id);
if (gettimeofday(&s->creation_time, NULL) != 0) if (gettimeofday(&s->creation_time, NULL) != 0)
fatal("gettimeofday failed"); fatal("gettimeofday failed");
session_update_activity(s, &s->creation_time); session_update_activity(s, &s->creation_time);
@ -264,6 +262,10 @@ session_update_activity(struct session *s, struct timeval *from)
else else
memcpy(&s->activity_time, from, sizeof s->activity_time); memcpy(&s->activity_time, from, sizeof s->activity_time);
log_debug("session %s activity %lld.%06d (last %lld.%06d)", s->name,
(long long)s->activity_time.tv_sec, (int)s->activity_time.tv_usec,
(long long)last->tv_sec, (int)last->tv_usec);
if (evtimer_initialized(&s->lock_timer)) if (evtimer_initialized(&s->lock_timer))
evtimer_del(&s->lock_timer); evtimer_del(&s->lock_timer);
else else