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-3ubuntu2) lucid-proposed; urgency=low + + * 10-retry_console_open_eio.patch: Retry console opens if they return EIO, + since this may happen while a tty is closing (see LP #554172, and thanks + to Lennie and others for extensing debugging work; LP: #544139). + + -- Colin Watson Wed, 10 Nov 2010 12:18:29 +0000 + consolekit (0.4.1-3ubuntu1) lucid; urgency=low * debian/90consolekit: gdm already creates a CK session for us, so do not 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_console_open_eio.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_console_open_eio.patch +++ consolekit-0.4.1/debian/patches/10-retry_console_open_eio.patch @@ -0,0 +1,38 @@ +Index: b/src/ck-sysdeps-unix.c +=================================================================== +--- a/src/ck-sysdeps-unix.c ++++ b/src/ck-sysdeps-unix.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -150,9 +151,25 @@ + { + int fd; + ++again: + fd = open (fnam, O_RDONLY | O_NOCTTY); + if (fd < 0 && errno == EACCES) + fd = open (fnam, O_WRONLY | O_NOCTTY); ++#ifdef __linux__ ++ if (fd < 0 && errno == EIO) { ++ /* Linux can return EIO if the tty is currently closing, ++ * which can happen if multiple processes are opening and ++ * closing the console in parallel. Unfortunately it can ++ * also return EIO in more serious situations too (see ++ * https://bugs.launchpad.net/bugs/554172), but there isn't ++ * much we can do about that since we really need a console ++ * fd. ++ */ ++ struct timespec ts = { 0, 100000000 }; /* 0.1 seconds */ ++ nanosleep (&ts, NULL); ++ goto again; ++ } ++#endif + + if (fd < 0) + return -1;