Bug 742805 - Do not dump ril socket failures on a desktop build with --enable-b2g-ril. r=philikon
authorVivien Nicolas <21@vingtetun.org>
Wed, 11 Apr 2012 10:05:35 -0700
changeset 91448 3e969e8c0eb49a3840a3dd34713f10372a1d5677
parent 91447 1d45940d8d69ef7edf36318a0b4934342dc7230d
child 91449 756b1c28a3e33093104063e345085df58f7d2291
push id22445
push usereakhgari@mozilla.com
push dateThu, 12 Apr 2012 16:19:55 +0000
treeherdermozilla-central@901dfde60183 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersphilikon
bugs742805
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 742805 - Do not dump ril socket failures on a desktop build with --enable-b2g-ril. r=philikon
dom/system/gonk/ril_worker.js
ipc/ril/Ril.cpp
--- a/dom/system/gonk/ril_worker.js
+++ b/dom/system/gonk/ril_worker.js
@@ -1961,17 +1961,17 @@ RIL[REQUEST_SIGNAL_STRENGTH] = function 
                        signalStrength: obj});
 };
 RIL[REQUEST_VOICE_REGISTRATION_STATE] = function REQUEST_VOICE_REGISTRATION_STATE(length, options) {
   if (options.rilRequestError) {
     return;
   }
 
   let state = Buf.readStringList();
-debug("voice registration state: " + state);
+  if (DEBUG) debug("voice registration state: " + state);
   this._processVoiceRegistrationState(state);
 };
 RIL[REQUEST_DATA_REGISTRATION_STATE] = function REQUEST_DATA_REGISTRATION_STATE(length, options) {
   if (options.rilRequestError) {
     return;
   }
 
   let state = Buf.readStringList();
@@ -2085,19 +2085,21 @@ RIL[REQUEST_SIM_IO] = function REQUEST_S
     return;
   }
 
   let sw1 = Buf.readUint32();
   let sw2 = Buf.readUint32();
   if (sw1 != ICC_STATUS_NORMAL_ENDING) {
     // See GSM11.11, TS 51.011 clause 9.4, and ISO 7816-4 for the error
     // description.
-    debug("ICC I/O Error EF id = " + options.fileid.toString(16) +
-          " command = " + options.command.toString(16) +
-          "(" + sw1.toString(16) + "/" + sw2.toString(16) + ")");
+    if (DEBUG) {
+      debug("ICC I/O Error EF id = " + options.fileid.toString(16) +
+            " command = " + options.command.toString(16) +
+            "(" + sw1.toString(16) + "/" + sw2.toString(16) + ")");
+    }
     return;
   }
 
   switch (options.fileid) {
     case ICC_EF_MSISDN:
       this._processMSISDNResponse(options);
       break;
   }
--- a/ipc/ril/Ril.cpp
+++ b/ipc/ril/Ril.cpp
@@ -224,17 +224,19 @@ RilClient::OpenSocket()
 #endif
 
     if (mSocket.mFd < 0) {
         LOG("Cannot create socket for RIL!\n");
         return false;
     }
 
     if (connect(mSocket.mFd, (struct sockaddr *) &addr, alen) < 0) {
+#if defined(MOZ_WIDGET_GONK)
         LOG("Cannot open socket for RIL!\n");
+#endif
         close(mSocket.mFd);
         return false;
     }
 
     // Set close-on-exec bit.
     int flags = fcntl(mSocket.mFd, F_GETFD);
     if (-1 == flags) {
         return false;