[mutter/wip/wayland] squash: Fix the logic for opening the non-abstract socket (again)



commit 69eeaa8b765334ba6999db2cb15a1b73be5bd67c
Author: Neil Roberts <neil linux intel com>
Date:   Thu Jul 18 13:41:50 2013 +0100

    squash: Fix the logic for opening the non-abstract socket (again)
    
    I broke the logic for opening the non-abstract X socket when I tried
    to fix it. This is based on the following commit in Clayland:
    
    https://github.com/clutter-project/clayland/commit/4fa2b369f2f25a
    
    This should be squashed into the commit:
      “wayland: Adds basic hybrid X + Wayland support”

 src/wayland/meta-wayland.c |   25 +++++++++++--------------
 1 files changed, 11 insertions(+), 14 deletions(-)
---
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index c307af0..32d9dbf 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -1299,26 +1299,23 @@ start_xwayland (MetaWaylandCompositor *compositor)
       compositor->xwayland_abstract_fd = bind_to_abstract_socket (display);
       if (compositor->xwayland_abstract_fd < 0)
         {
+          unlink (lockfile);
+
           if (errno == EADDRINUSE)
             {
-              unlink (lockfile);
               display++;
               continue;
             }
+          else
+            return FALSE;
+        }
 
-          compositor->xwayland_unix_fd = bind_to_unix_socket (display);
-          if (compositor->xwayland_abstract_fd < 0)
-            {
-              unlink (lockfile);
-
-              if (errno == EADDRINUSE)
-                {
-                  display++;
-                  continue;
-                }
-              else
-                return FALSE;
-            }
+      compositor->xwayland_unix_fd = bind_to_unix_socket (display);
+      if (compositor->xwayland_abstract_fd < 0)
+        {
+          unlink (lockfile);
+          close (compositor->xwayland_abstract_fd);
+          return FALSE;
         }
 
       break;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]