From 8501b95f222d9635ef69c5c1fbc9620983127733 Mon Sep 17 00:00:00 2001 From: Yong Zhi Date: Wed, 16 Nov 2016 23:36:36 -0600 Subject: CRAS: use R_OK to test file read permission Use macros defined in unistd.h for how argument of int access(const char *file, int how) function. BUG=chrome-os-partner:59363 TEST=reboot and test headset plug status Change-Id: I62318948dd4e4f70fa869d7ce7f0f7d27ce8a706 Signed-off-by: Yong Zhi Reviewed-on: https://chromium-review.googlesource.com/412203 Commit-Ready: Nicolas Boichat Tested-by: Sathyanarayana Nujella Tested-by: Anson Tseng Reviewed-by: Sathyanarayana Nujella Reviewed-by: Anson Tseng Reviewed-by: Dylan Reid --- cras/src/server/cras_alsa_jack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cras/src/server/cras_alsa_jack.c b/cras/src/server/cras_alsa_jack.c index c5435c69..9e8ba185 100644 --- a/cras/src/server/cras_alsa_jack.c +++ b/cras/src/server/cras_alsa_jack.c @@ -640,7 +640,7 @@ static int wait_for_dev_input_access() timeout.tv_sec = 0; timeout.tv_usec = 500000; /* 1/2 second. */ - readable = access(pathname, O_RDONLY); + readable = access(pathname, R_OK); /* If the file could be opened, then the udev rule has been * applied and gavd can read the event files. If there are no -- cgit v1.2.3