Explorar o código

libkcore Disable checking of /proc files on non-linux systems

Olle E. Johansson %!s(int64=10) %!d(string=hai) anos
pai
achega
45c3dbee61
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      lib/kcore/statistics.c

+ 6 - 0
lib/kcore/statistics.c

@@ -371,6 +371,12 @@ static int get_used_waiting_queue(
 	
 	int  waitingQueueSize = 0;
 
+#ifndef __OS_linux
+	/* /proc/net/tcp and /proc/net/udp only exists on Linux systems, so don't bother with
+	   trying to open these files */
+	return 0;
+#endif
+
 	/* Set up the file we want to open. */
 	if (forTCP) {
 		fileToOpen = "/proc/net/tcp";