# HG changeset patch # User kaf24@scramble.cl.cam.ac.uk # Date 1058193234 0 # Node ID ef9e002c0596dd7cd1864e4120901b5fb49641cf # Parent fc9e107245923ed396d2e815fd8ffb97ff4d92a7 bitkeeper revision 1.339.1.5 (3f12bf52q2jR3Bjy5IVRUmb2tYPLpw) dom0_defs.h: Fix xi_ tools to get return code from privcmd proc file. diff -r fc9e10724592 -r ef9e002c0596 tools/internal/dom0_defs.h --- a/tools/internal/dom0_defs.h Mon Jul 14 10:50:17 2003 +0000 +++ b/tools/internal/dom0_defs.h Mon Jul 14 14:33:54 2003 +0000 @@ -14,7 +14,14 @@ #include #include -#include +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 @@ -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 in 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 in } close(fd); - return 0; + return ret; } static inline int xldev_to_physdev(int xldev)