Bug 1119907 - Cleanup some errors when USE_DEBUG is enabled in the AutoMounter.
authorDave Hylands <dhylands@mozilla.com>
Fri, 09 Jan 2015 15:29:15 -0800
changeset 236184 5638d5c013a4a18b748e1ffa040d42c653b63756
parent 236183 15a1d345983527b2bc69ddb1d72911af5ddf2886
child 236185 c93994916b6d730ca7f9ef88b1659cc77dc96cd6
push id391
push usermcmanus@ducksong.com
push dateMon, 12 Jan 2015 18:26:35 +0000
bugs1119907
milestone37.0a1
Bug 1119907 - Cleanup some errors when USE_DEBUG is enabled in the AutoMounter.
dom/system/gonk/VolumeManager.cpp
dom/system/gonk/VolumeManagerLog.h
dom/system/gonk/nsVolumeService.cpp
--- a/dom/system/gonk/VolumeManager.cpp
+++ b/dom/system/gonk/VolumeManager.cpp
@@ -383,17 +383,17 @@ VolumeManager::WriteCommandData()
   }
   // There are more bytes left to write. Try to write them all.
   ssize_t bytesWritten = write(mSocket.get(), cmd->Data(), cmd->BytesRemaining());
   if (bytesWritten < 0) {
     ERR("Failed to write %d bytes to vold socket", cmd->BytesRemaining());
     Restart();
     return;
   }
-  DBG("Wrote %ld bytes (of %d)", bytesWritten, cmd->BytesRemaining());
+  DBG("Wrote %d bytes (of %d)", bytesWritten, cmd->BytesRemaining());
   cmd->ConsumeBytes(bytesWritten);
   if (cmd->BytesRemaining() == 0) {
     return;
   }
   // We were unable to write all of the command bytes. Setup a watcher
   // so we'll get called again when we can write without blocking.
   if (!MessageLoopForIO::current()->
       WatchFileDescriptor(mSocket.get(),
--- a/dom/system/gonk/VolumeManagerLog.h
+++ b/dom/system/gonk/VolumeManagerLog.h
@@ -1,15 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_system_volumemanagerlog_h__
 #define mozilla_system_volumemanagerlog_h__
 
+#undef USE_DEBUG
 #define USE_DEBUG 0
 
 #if !defined(VOLUME_MANAGER_LOG_TAG)
 #define VOLUME_MANAGER_LOG_TAG  "VolumeManager"
 #endif
 
 #undef LOG
 #undef ERR
--- a/dom/system/gonk/nsVolumeService.cpp
+++ b/dom/system/gonk/nsVolumeService.cpp
@@ -504,16 +504,16 @@ private:
 void
 nsVolumeService::UpdateVolumeIOThread(const Volume* aVolume)
 {
   DBG("UpdateVolumeIOThread: Volume '%s' state %s mount '%s' gen %d locked %d "
       "media %d sharing %d formatting %d unmounting %d removable %d hotswappable %d",
       aVolume->NameStr(), aVolume->StateStr(), aVolume->MountPoint().get(),
       aVolume->MountGeneration(), (int)aVolume->IsMountLocked(),
       (int)aVolume->MediaPresent(), (int)aVolume->IsSharing(),
-      (int)aVolume->IsFormatting(), (int)mVolume->IsUnmounting(),
-      (int)aVolume->IsRemovable(), (int)mVolume->IsHotSwappable());
+      (int)aVolume->IsFormatting(), (int)aVolume->IsUnmounting(),
+      (int)aVolume->IsRemovable(), (int)aVolume->IsHotSwappable());
   MOZ_ASSERT(MessageLoop::current() == XRE_GetIOMessageLoop());
   NS_DispatchToMainThread(new UpdateVolumeRunnable(this, aVolume));
 }
 
 } // namespace system
 } // namespace mozilla