diff options
author | kaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk> | 2003-07-14 14:33:54 +0000 |
---|---|---|
committer | kaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk> | 2003-07-14 14:33:54 +0000 |
commit | d82b7d255e0535d506d105b83a397fd6461bec17 (patch) | |
tree | 72b77bacff9e66fd1edfca9e830f33814a54043a /tools | |
parent | a6c6999b79dceecaac7b3f2ee7f06eb137f81a23 (diff) | |
download | xen-d82b7d255e0535d506d105b83a397fd6461bec17.tar.gz xen-d82b7d255e0535d506d105b83a397fd6461bec17.tar.bz2 xen-d82b7d255e0535d506d105b83a397fd6461bec17.zip |
bitkeeper revision 1.339.1.5 (3f12bf52q2jR3Bjy5IVRUmb2tYPLpw)
dom0_defs.h:
Fix xi_ tools to get return code from privcmd proc file.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/internal/dom0_defs.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tools/internal/dom0_defs.h b/tools/internal/dom0_defs.h index 9ef8d0645d..2a59c2553b 100644 --- a/tools/internal/dom0_defs.h +++ b/tools/internal/dom0_defs.h @@ -14,7 +14,14 @@ #include <errno.h> #include <string.h> -#include <asm/types.h> +typedef unsigned char u8; +typedef unsigned short u16; +typedef unsigned long u32; +typedef unsigned long long u64; +typedef signed char s8; +typedef signed short s16; +typedef signed long s32; +typedef signed long long s64; #include "mem_defs.h" #include <asm-xeno/proc_cmd.h> @@ -29,7 +36,7 @@ static inline int do_privcmd(unsigned int cmd, unsigned long data) { - int fd; + int fd, ret; if ( (fd = open("/proc/xeno/privcmd", O_RDWR)) < 0 ) { @@ -37,7 +44,7 @@ static inline int do_privcmd(unsigned int cmd, unsigned long data) return -1; } - if ( ioctl(fd, cmd, data) < 0 ) + if ( (ret = ioctl(fd, cmd, data)) < 0 ) { #ifndef SILENT_ERRORS_FROM_XEN PERROR("Error when executing privileged control ioctl"); @@ -47,7 +54,7 @@ static inline int do_privcmd(unsigned int cmd, unsigned long data) } close(fd); - return 0; + return ret; } static inline int xldev_to_physdev(int xldev) |