Bug 1332167: Unix major() and minor() return unsigned r=froydnj
authorRandell Jesup <rjesup@jesup.org>
Fri, 20 Jan 2017 10:38:43 -0500
changeset 377642 25e81b94c1531e05836404306ddafbe778ab36a0
parent 377641 529ae909938a4759d8ad7b200cf9dab067b5215f
child 377643 004ad2adfd6eb097cf6e32d866b2544db9a22804
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1332167
milestone53.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 1332167: Unix major() and minor() return unsigned r=froydnj
xpcom/io/nsLocalFileUnix.cpp
--- a/xpcom/io/nsLocalFileUnix.cpp
+++ b/xpcom/io/nsLocalFileUnix.cpp
@@ -1282,27 +1282,28 @@ nsLocalFile::GetFileSizeOfLink(int64_t* 
 #if defined(USE_LINUX_QUOTACTL)
 /*
  * Searches /proc/self/mountinfo for given device (Major:Minor),
  * returns exported name from /dev
  *
  * Fails when /proc/self/mountinfo or diven device don't exist.
  */
 static bool
-GetDeviceName(int aDeviceMajor, int aDeviceMinor, nsACString& aDeviceName)
+GetDeviceName(unsigned int aDeviceMajor, unsigned int aDeviceMinor,
+              nsACString& aDeviceName)
 {
   bool ret = false;
 
   const int kMountInfoLineLength = 200;
   const int kMountInfoDevPosition = 6;
 
   char mountinfoLine[kMountInfoLineLength];
   char deviceNum[kMountInfoLineLength];
 
-  SprintfLiteral(deviceNum, "%d:%d", aDeviceMajor, aDeviceMinor);
+  SprintfLiteral(deviceNum, "%u:%u", aDeviceMajor, aDeviceMinor);
 
   FILE* f = fopen("/proc/self/mountinfo", "rt");
   if (!f) {
     return ret;
   }
 
   // Expects /proc/self/mountinfo in format:
   // 'ID ID major:minor root mountpoint flags - type devicename flags'