From cc6d793310ad81d64a18d111ab33043791b92a52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Tue, 12 Nov 2019 04:01:32 -0800 Subject: [PATCH] fix 'adb shell' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fcntl uses FD_CLOEXEC not O_CLOEXEC Test: adb shell now works on cuttlefish Bug: 144313654 Signed-off-by: Maciej Żenczykowski Change-Id: I5dbac5a46cbc9d24f8622076a3a553028ba648db --- adb/sysdeps.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adb/sysdeps.h b/adb/sysdeps.h index 979413a3d..0c5a6b4c1 100644 --- a/adb/sysdeps.h +++ b/adb/sysdeps.h @@ -355,8 +355,8 @@ static __inline__ int get_fd_flags(borrowed_fd fd) { static __inline__ void close_on_exec(borrowed_fd fd) { int flags = get_fd_flags(fd); - if (flags >= 0 && (flags & O_CLOEXEC) == 0) { - fcntl(fd.get(), F_SETFD, flags | O_CLOEXEC); + if (flags >= 0 && (flags & FD_CLOEXEC) == 0) { + fcntl(fd.get(), F_SETFD, flags | FD_CLOEXEC); } }