direct-io.hg

changeset 617:ef9e002c0596

bitkeeper revision 1.339.1.5 (3f12bf52q2jR3Bjy5IVRUmb2tYPLpw)

dom0_defs.h:
Fix xi_ tools to get return code from privcmd proc file.
author kaf24@scramble.cl.cam.ac.uk
date Mon Jul 14 14:33:54 2003 +0000 (2003-07-14)
parents fc9e10724592
children c7557b3832b9
files tools/internal/dom0_defs.h
line diff
     1.1 --- a/tools/internal/dom0_defs.h	Mon Jul 14 10:50:17 2003 +0000
     1.2 +++ b/tools/internal/dom0_defs.h	Mon Jul 14 14:33:54 2003 +0000
     1.3 @@ -14,7 +14,14 @@
     1.4  #include <errno.h>
     1.5  #include <string.h>
     1.6  
     1.7 -#include <asm/types.h>
     1.8 +typedef unsigned char      u8;
     1.9 +typedef unsigned short     u16;
    1.10 +typedef unsigned long      u32;
    1.11 +typedef unsigned long long u64;
    1.12 +typedef signed char        s8;
    1.13 +typedef signed short       s16;
    1.14 +typedef signed long        s32;
    1.15 +typedef signed long long   s64;
    1.16  
    1.17  #include "mem_defs.h"
    1.18  #include <asm-xeno/proc_cmd.h>
    1.19 @@ -29,7 +36,7 @@
    1.20  
    1.21  static inline int do_privcmd(unsigned int cmd, unsigned long data)
    1.22  {
    1.23 -    int fd;
    1.24 +    int fd, ret;
    1.25  
    1.26      if ( (fd = open("/proc/xeno/privcmd", O_RDWR)) < 0 )
    1.27      {
    1.28 @@ -37,7 +44,7 @@ static inline int do_privcmd(unsigned in
    1.29          return -1;
    1.30      }
    1.31  
    1.32 -    if ( ioctl(fd, cmd, data) < 0 )
    1.33 +    if ( (ret = ioctl(fd, cmd, data)) < 0 )
    1.34      {
    1.35  #ifndef SILENT_ERRORS_FROM_XEN
    1.36          PERROR("Error when executing privileged control ioctl");
    1.37 @@ -47,7 +54,7 @@ static inline int do_privcmd(unsigned in
    1.38      }
    1.39  
    1.40      close(fd);
    1.41 -    return 0;
    1.42 +    return ret;
    1.43  }
    1.44  
    1.45  static inline int xldev_to_physdev(int xldev)