Bug 817939 - restart ioctl with EINTR for FMRadio. r=jlebar a=blocking-basecamp
authorThinker K.F. Li <thinker@codemud.net>
Wed, 09 Jan 2013 10:22:33 +0100
changeset 118035 e21583a0031383dda3627cc9cb17d4df2ccf40b1
parent 118034 49437997e25f76e04ff92481d5b204fdb2db0322
child 118036 6975c38ff5f6449112604087472ea89df5ca82ff
push id162
push userkchen@mozilla.com
push dateWed, 09 Jan 2013 09:22:48 +0000
reviewersjlebar, blocking-basecamp
bugs817939
milestone18.0
Bug 817939 - restart ioctl with EINTR for FMRadio. r=jlebar a=blocking-basecamp
hal/gonk/GonkFMRadio.cpp
--- a/hal/gonk/GonkFMRadio.cpp
+++ b/hal/gonk/GonkFMRadio.cpp
@@ -184,18 +184,21 @@ runTavaruaRadio(void *)
   uint8_t buf[128];
   struct v4l2_buffer buffer = {0};
   buffer.index = 1;
   buffer.type = V4L2_BUF_TYPE_PRIVATE;
   buffer.length = sizeof(buf);
   buffer.m.userptr = (long unsigned int)buf;
 
   while (sRadioEnabled) {
-    if (ioctl(sRadioFD, VIDIOC_DQBUF, &buffer) < 0)
+    if (ioctl(sRadioFD, VIDIOC_DQBUF, &buffer) < 0) {
+      if (errno == EINTR)
+        continue;
       break;
+    }
 
     for (unsigned int i = 0; i < buffer.bytesused; i++) {
       switch (buf[i]) {
       case TAVARUA_EVT_RADIO_READY:
         NS_DispatchToMainThread(new RadioUpdate(hal::FM_RADIO_OPERATION_ENABLE,                                                 hal::FM_RADIO_OPERATION_STATUS_SUCCESS));
         break;
       case TAVARUA_EVT_SEEK_COMPLETE:
         NS_DispatchToMainThread(new RadioUpdate(hal::FM_RADIO_OPERATION_SEEK,