[oe-commits] [bitbake] branch master-next updated: hashserv fixup

git at git.openembedded.org git at git.openembedded.org
Wed Sep 18 10:52:45 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository bitbake.

The following commit(s) were added to refs/heads/master-next by this push:
     new b31de77  hashserv fixup
b31de77 is described below

commit b31de77665851fd1745ced8aa0abc26df7b4ea9a
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Wed Sep 18 11:49:28 2019 +0100

    hashserv fixup
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/hashserv/client.py | 8 +++++++-
 lib/hashserv/server.py | 5 ++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/lib/hashserv/client.py b/lib/hashserv/client.py
index 4d3c35f..2559bbb 100644
--- a/lib/hashserv/client.py
+++ b/lib/hashserv/client.py
@@ -40,7 +40,13 @@ class Client(object):
     def connect_unix(self, path):
         def connect_sock():
             s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
-            s.connect(path)
+            # AF_UNIX has path length issues so chdir here to workaround
+            cwd = os.getcwd()
+            try:
+                os.chdir(os.path.dirname(path))
+                s.connect(os.path.basename(path))
+            finally:
+                os.chdir(cwd)
             return s
 
         self._connect_sock = connect_sock
diff --git a/lib/hashserv/server.py b/lib/hashserv/server.py
index 0ffc83c..cddf8eb 100644
--- a/lib/hashserv/server.py
+++ b/lib/hashserv/server.py
@@ -365,8 +365,11 @@ class Server(object):
         def cleanup():
             os.unlink(path)
 
+        # Work around path length limits in AF_UNIX
+        os.chdir(os.path.dirname(path))
+
         self.server = self.loop.run_until_complete(
-            asyncio.start_unix_server(self.handle_client, path, loop=self.loop)
+            asyncio.start_unix_server(self.handle_client, os.path.basename(path), loop=self.loop)
         )
         logger.info('Listening on %r' % path)
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list