Skip to contentSkip to conversation

tools/libs/*: freebsd remove unused code

PATCH In review Ian Campbell 2 participants 3 messages Jan 25, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/libs/*: freebsd remove unused code

"tools/libs/*: Use O_CLOEXEC on Linux and FreeBSD" left some dead code in the FreeBSD case, which breaks the build on that platform.

Also fix a typo "uint_32".

---
 tools/libs/call/freebsd.c          | 8 --------
 tools/libs/evtchn/freebsd.c        | 2 +-
 tools/libs/foreignmemory/freebsd.c | 8 --------
 3 files changed, 1 insertion(+), 17 deletions(-)
tools/libs/call/freebsd.c +0 -8
index b3cbccd..cadd313 100644
@@ -35,7 +35,6 @@
 
 int osdep_xencall_open(xencall_handle *xcall)
 {
-    int saved_errno;
     int fd = open(PRIVCMD_DEV, O_RDWR|O_CLOEXEC);
 
     /*
@@ -53,13 +52,6 @@ int osdep_xencall_open(xencall_handle *xcall)
 
     xcall->fd = fd;
     return 0;
-
- error:
-    saved_errno = errno;
-    close(fd);
-    errno = saved_errno;
-
-    return -1;
 }
 
 int osdep_xencall_close(xencall_handle *xcall)
tools/libs/evtchn/freebsd.c +1 -1
index ddf221d..ead2e71 100644
@@ -74,7 +74,7 @@ evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, uint32
 }
 
 evtchn_port_or_error_t
-xenevtchn_bind_interdomain(xenevtchn_handle *xce, uint_32 domid, evtchn_port_t remote_port)
+xenevtchn_bind_interdomain(xenevtchn_handle *xce, uint32_t domid, evtchn_port_t remote_port)
 {
     int ret, fd = xce->fd;
     struct ioctl_evtchn_bind_interdomain bind;
tools/libs/foreignmemory/freebsd.c +0 -8
index 7bf3939..ef08b6c 100644
@@ -33,7 +33,6 @@
 
 int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
 {
-    int saved_errno;
     int fd = open(PRIVCMD_DEV, O_RDWR|O_CLOEXEC);
 
     if ( fd == -1 )
@@ -45,13 +44,6 @@ int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
 
     fmem->fd = fd;
     return 0;
-
- error:
-    saved_errno = errno;
-    close(fd);
-    errno = saved_errno;
-
-    return -1;
 }
 
 int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem)
Signature · 1 line
2.6.1
author Applied
#2 lore raw
Quoted 9 lines · Wei Liu
Quoted 6 lines · Ian Campbell

"tools/libs/*: Use O_CLOEXEC on Linux and FreeBSD" left some dead code in the FreeBSD case, which breaks the build on that platform.

Also fix a typo "uint_32".

Applied.

(FTR, I skipped my usual full set of usual pre-push build tests, since the machines I use are unavailable right now. I have done an x86_64 make dist).