]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/mini-os.git/commitdiff
minios: reverse layering of xc vs minios fd close
authorKeir Fraser <keir@xen.org>
Fri, 3 Dec 2010 06:37:48 +0000 (06:37 +0000)
committerKeir Fraser <keir@xen.org>
Fri, 3 Dec 2010 06:37:48 +0000 (06:37 +0000)
Having minios close() call back into the libxc core close routines is
backwards and unexpected. On every other OS the libxc core close
routine calls close().

Export minios specific functions from the minios libxc code to
implement fd closing for each type of xc file handle and simply call
close() in the core close routine.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
lib/sys.c

index 42681742b8e999c2308fb3eff9d7ce916000f463..b127996df5cef19bd49d5bf8364547fc709c1917 100644 (file)
--- a/lib/sys.c
+++ b/lib/sys.c
     }
 
 #define NOFILE 32
-extern int xc_evtchn_close(int fd);
-struct xc_interface;
-extern int xc_interface_close_core(struct xc_interface*, int fd);
-extern int xc_gnttab_close(int fd);
+extern void minios_interface_close_fd(int fd);
+extern void minios_evtchn_close_fd(int fd);
+extern void minios_gnttab_close_fd(int fd);
 
 pthread_mutex_t fd_lock = PTHREAD_MUTEX_INITIALIZER;
 struct file files[NOFILE] = {
@@ -414,13 +413,13 @@ int close(int fd)
        }
 #endif
        case FTYPE_XC:
-           xc_interface_close_core(0,fd);
+           minios_interface_close_fd(fd);
            return 0;
        case FTYPE_EVTCHN:
-            xc_evtchn_close(fd);
+           minios_evtchn_close_fd(fd);
             return 0;
        case FTYPE_GNTMAP:
-           xc_gnttab_close(fd);
+           minios_gnttab_close_fd(fd);
            return 0;
        case FTYPE_TAP:
            shutdown_netfront(files[fd].tap.dev);