Browse Source

arm: use PATH_MEM in ioperm()

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer 12 năm trước cách đây
mục cha
commit
9756397b62
1 tập tin đã thay đổi với 7 bổ sung12 xóa
  1. 7 12
      libc/sysdeps/linux/arm/ioperm.c

+ 7 - 12
libc/sysdeps/linux/arm/ioperm.c

@@ -33,21 +33,16 @@
    the area affected (this is a kernel limitation).  So we now just
    enable all the ports all of the time.  */
 
+#include <sys/io.h>
+#include <sys/mman.h>
+#include <sys/sysctl.h>
+#include <paths.h>
 #include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
 #include <ctype.h>
-#include <stdlib.h>
+#include <stdio.h>
 #include <string.h>
 #include <unistd.h>
-
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <sys/sysctl.h>
-#include <sys/io.h>
-
-
-
+#include <fcntl.h>
 #include <linux/version.h>
 
 #define PATH_ARM_SYSTYPE	"/etc/arm_systype"
@@ -186,7 +181,7 @@ int ioperm (unsigned long int from, unsigned long int num, int turn_on)
 	if (! io.base) {
 	    int fd;
 
-	    fd = open ("/dev/mem", O_RDWR);
+	    fd = open (_PATH_MEM, O_RDWR);
 	    if (fd < 0)
 		return -1;