diff --git a/awesome.c b/awesome.c index 3513cecf..54cb871d 100644 --- a/awesome.c +++ b/awesome.c @@ -404,6 +404,7 @@ a_glib_poll(GPollFD *ufds, guint nfsd, gint timeout) guint res; struct timeval now, length_time; float length; + int saved_errno; lua_State *L = globalconf_get_lua_State(); /* Do all deferred work now */ @@ -434,8 +435,10 @@ a_glib_poll(GPollFD *ufds, guint nfsd, gint timeout) /* Actually do the polling, record time of wakeup and check for new xcb events */ res = g_poll(ufds, nfsd, timeout); + saved_errno = errno; gettimeofday(&last_wakeup, NULL); a_xcb_check(); + errno = saved_errno; return res; }