diff -u consolekit-0.4.1/debian/changelog consolekit-0.4.1/debian/changelog --- consolekit-0.4.1/debian/changelog +++ consolekit-0.4.1/debian/changelog @@ -1,3 +1,11 @@ +consolekit (0.4.1-4ubuntu1~ppa1) maverick; urgency=low + + * debian/patches/10-retry_waitactive_einval.patch: Retry VT_WAITACTIVE if + it returns EINVAL, which may happen while the X server is starting + (LP: #544139). + + -- Colin Watson Fri, 20 Aug 2010 16:05:15 +0100 + consolekit (0.4.1-4) unstable; urgency=low [ Martin Pitt ] diff -u consolekit-0.4.1/debian/control consolekit-0.4.1/debian/control --- consolekit-0.4.1/debian/control +++ consolekit-0.4.1/debian/control @@ -1,7 +1,8 @@ Source: consolekit Section: admin Priority: optional -Maintainer: Utopia Maintenance Team +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Utopia Maintenance Team Uploaders: Michael Biebl Build-Depends: cdbs, debhelper (>= 7), diff -u consolekit-0.4.1/debian/patches/series consolekit-0.4.1/debian/patches/series --- consolekit-0.4.1/debian/patches/series +++ consolekit-0.4.1/debian/patches/series @@ -3,6 +3,7 @@ 02-dont_take_bus_name_until_ready.patch 03-cleanup_console_tags.patch 04-dont_fail_with_invalid_seats_file.patch +10-retry_waitactive_einval.patch 80-gnukfreebsd_support_configure.ac.patch 82-hurd_support.patch 99-autoreconf.patch only in patch2: unchanged: --- consolekit-0.4.1.orig/debian/patches/10-retry_waitactive_einval.patch +++ consolekit-0.4.1/debian/patches/10-retry_waitactive_einval.patch @@ -0,0 +1,89 @@ +Index: b/src/ck-sysdeps-unix.c +=================================================================== +--- a/src/ck-sysdeps-unix.c ++++ b/src/ck-sysdeps-unix.c +@@ -272,6 +272,7 @@ + + if (res == ERROR) { + const char *errmsg; ++ int save_errno = errno; + + errmsg = g_strerror (errno); + +@@ -287,6 +288,7 @@ + num, + errmsg); + } ++ errno = save_errno; + goto out; + } + +Index: b/src/ck-vt-monitor.c +=================================================================== +--- a/src/ck-vt-monitor.c ++++ b/src/ck-vt-monitor.c +@@ -223,6 +223,9 @@ + typedef struct { + gint32 num; + CkVtMonitor *vt_monitor; ++ GCond *cond; ++ GMutex *mutex; ++ int retries; + } ThreadData; + + typedef struct { +@@ -236,6 +239,8 @@ + return; + } + ++ g_mutex_free (data->mutex); ++ g_cond_free (data->cond); + g_free (data); + } + +@@ -317,10 +322,26 @@ + + vt_monitor = data->vt_monitor; + num = data->num; ++ g_mutex_lock (data->mutex); + ++again: + res = ck_wait_for_active_console_num (vt_monitor->priv->vfd, num); + if (! res) { +- /* FIXME: what do we do if it fails? */ ++ if (errno == EINVAL && data->retries++ < 10) { ++ /* This can happen when the X server is busy ++ * starting. Back off and try again in a second's ++ * time, for at most ten seconds. ++ */ ++ GTimeVal next_time; ++ ++ g_get_current_time (&next_time); ++ g_time_val_add (&next_time, 1000000); ++ g_cond_timed_wait (data->cond, data->mutex, ++ &next_time); ++ goto again; ++ } else { ++ /* FIXME: what do we do if it fails? */ ++ } + } else { + EventData *event; + +@@ -334,6 +355,7 @@ + /* schedule processing of queue */ + schedule_process_queue (vt_monitor); + } ++ g_mutex_unlock (data->mutex); + + G_LOCK (hash_lock); + if (vt_monitor->priv->vt_thread_hash != NULL) { +@@ -359,6 +381,9 @@ + data = g_new0 (ThreadData, 1); + data->num = num; + data->vt_monitor = vt_monitor; ++ data->cond = g_cond_new (); ++ data->mutex = g_mutex_new (); ++ data->retries = 0; + + g_debug ("Creating thread for vt %d", num); +