From 55e4317e7920a8175c089e836edbeb69e634ca59 Mon Sep 17 00:00:00 2001 From: Chengwei Yang Date: Wed, 11 Sep 2013 12:59:21 +0800 Subject: [PATCH] Check EINVAL for accept4() It was reported that accept4() will return -1 with errrno is EINVAL on arm platform, so check EINVAL for accept4() and retry accept(). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69026 --- dbus/dbus-sysdeps-unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c index 1cb4a58..69f1ae4 100644 --- a/dbus/dbus-sysdeps-unix.c +++ b/dbus/dbus-sysdeps-unix.c @@ -1946,7 +1946,7 @@ _dbus_accept (int listen_fd) client_fd = accept4 (listen_fd, &addr, &addrlen, SOCK_CLOEXEC); cloexec_done = client_fd >= 0; - if (client_fd < 0 && errno == ENOSYS) + if (client_fd < 0 && (errno == ENOSYS || errno == EINVAL)) #endif { client_fd = accept (listen_fd, &addr, &addrlen); -- 1.7.9.5