diff options
author | hailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2010-06-21 23:20:15 +0000 |
---|---|---|
committer | hailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2010-06-21 23:20:15 +0000 |
commit | 3f52c8813d2846effdcfcd3abef9d0f53240a56b (patch) | |
tree | 21e5b1ed74666095913b80cbb08fb0a822bf14ba /hwaccess.c | |
parent | 854211f63b8ccc45a2a834e7d7b378aec2055ba0 (diff) | |
download | flashrom-3f52c8813d2846effdcfcd3abef9d0f53240a56b.tar.gz |
Kill unneeded #include wherever possible.
Tested on Linux, FreeBSD, NetBSD, OpenBSD, DOS.
Thanks to Jonathan A. Kollasch and Idwer Vollering for testing.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Idwer Vollering <vidwer+lists.flashrom@gmail.com>
git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1057 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'hwaccess.c')
-rw-r--r-- | hwaccess.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -21,10 +21,12 @@ #include <stdint.h> #include <string.h> #include <stdlib.h> +#include <sys/types.h> +#if !defined (__DJGPP__) #include <unistd.h> #include <fcntl.h> -#include <sys/types.h> #include <errno.h> +#endif #include "flash.h" #if defined(__i386__) || defined(__x86_64__) @@ -42,12 +44,14 @@ int io_fd; void get_io_perms(void) { +#if defined(__DJGPP__) + /* We have full permissions by default. */ + return; +#else #if defined (__sun) && (defined(__i386) || defined(__amd64)) if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) != 0) { #elif defined(__FreeBSD__) || defined (__DragonFly__) if ((io_fd = open("/dev/io", O_RDWR)) < 0) { -#elif __DJGPP__ - if (0) { #else if (iopl(3) != 0) { #endif @@ -55,6 +59,7 @@ void get_io_perms(void) "You need to be root.\n", strerror(errno)); exit(1); } +#endif } void release_io_perms(void) |