From 09e865b69489aa72786f80093522d7108d43745b Mon Sep 17 00:00:00 2001 From: Andy Hung Date: Mon, 1 Jun 2020 14:49:26 -0700 Subject: [PATCH] SoundPool: fix fcntl argument Fixes flakiness introduced by commit 77eb2bda0e5758b7c350db2991d6fc5806680b57 Test: android.media.cts.SoundPoolAacTest Test: android.media.cts.SoundPoolHapticTest Test: android.media.cts.SoundPoolMidiTest Test: android.media.cts.SoundPoolOggTest Test: android.media.cts.AudioManagerTest#testSoundEffects Bug: 157924783 Change-Id: I8371c93337852424e2b47a17e5a19a1caaf2600f --- media/jni/soundpool/Sound.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/jni/soundpool/Sound.cpp b/media/jni/soundpool/Sound.cpp index c3abdc22b19de..f8b4bdb1f4d55 100644 --- a/media/jni/soundpool/Sound.cpp +++ b/media/jni/soundpool/Sound.cpp @@ -31,7 +31,7 @@ constexpr size_t kDefaultHeapSize = 1024 * 1024; // 1MB (compatible with low m Sound::Sound(int32_t soundID, int fd, int64_t offset, int64_t length) : mSoundID(soundID) - , mFd(fcntl(fd, F_DUPFD_CLOEXEC)) // like dup(fd) but closes on exec to prevent leaks. + , mFd(fcntl(fd, F_DUPFD_CLOEXEC, (int)0 /* arg */)) // dup(fd) + close on exec to prevent leaks. , mOffset(offset) , mLength(length) {