Fix sysconf return type
authorMichael Lee <mzlee@fb.com>
Tue, 20 Dec 2016 14:21:48 +0000 (06:21 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 20 Dec 2016 14:32:52 +0000 (06:32 -0800)
Summary: The sysconf return type is supposed to be long, not unsigned.

Reviewed By: Orvid

Differential Revision: D4350903

fbshipit-source-id: 29d86081bf75d123e76b831a669b0fd3936ce102

folly/detail/CacheLocality.cpp

index b514c60693b43ec58a48e7f383643bc8ed2d1322..4603c1d5b0bf39a427fa46a41d3ec9863d8672fb 100644 (file)
@@ -43,7 +43,7 @@ static CacheLocality getSystemLocalityInfo() {
   }
 #endif
 
-  size_t numCpus = sysconf(_SC_NPROCESSORS_CONF);
+  long numCpus = sysconf(_SC_NPROCESSORS_CONF);
   if (numCpus <= 0) {
     // This shouldn't happen, but if it does we should try to keep
     // going.  We are probably not going to be able to parse /sys on