diff mbox

tools/libs/*: freebsd remove unused code

Message ID 1453727674-22183-1-git-send-email-ian.campbell@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ian Campbell Jan. 25, 2016, 1:14 p.m. UTC
"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".

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 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(-)

Comments

Wei Liu Jan. 25, 2016, 1:27 p.m. UTC | #1
On Mon, Jan 25, 2016 at 01:14:34PM +0000, Ian Campbell wrote:
> "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".
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>
Ian Campbell Jan. 25, 2016, 2:22 p.m. UTC | #2
On Mon, 2016-01-25 at 13:27 +0000, Wei Liu wrote:
> On Mon, Jan 25, 2016 at 01:14:34PM +0000, Ian Campbell wrote:
> > "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".
> > 
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> 
> Acked-by: Wei Liu <wei.liu2@citrix.com>

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).
diff mbox

Patch

diff --git a/tools/libs/call/freebsd.c b/tools/libs/call/freebsd.c
index b3cbccd..cadd313 100644
--- a/tools/libs/call/freebsd.c
+++ b/tools/libs/call/freebsd.c
@@ -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)
diff --git a/tools/libs/evtchn/freebsd.c b/tools/libs/evtchn/freebsd.c
index ddf221d..ead2e71 100644
--- a/tools/libs/evtchn/freebsd.c
+++ b/tools/libs/evtchn/freebsd.c
@@ -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;
diff --git a/tools/libs/foreignmemory/freebsd.c b/tools/libs/foreignmemory/freebsd.c
index 7bf3939..ef08b6c 100644
--- a/tools/libs/foreignmemory/freebsd.c
+++ b/tools/libs/foreignmemory/freebsd.c
@@ -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)