svn commit: r327541 - head/lib/libcasper/libcasper

Mariusz Zaborski oshogbo at FreeBSD.org
Thu Jan 4 08:23:25 UTC 2018


Author: oshogbo
Date: Thu Jan  4 08:23:23 2018
New Revision: 327541
URL: https://svnweb.freebsd.org/changeset/base/327541

Log:
  cap_unwrap should return a descriptor but also free the structure.

Modified:
  head/lib/libcasper/libcasper/libcasper.h

Modified: head/lib/libcasper/libcasper/libcasper.h
==============================================================================
--- head/lib/libcasper/libcasper/libcasper.h	Thu Jan  4 04:11:40 2018	(r327540)
+++ head/lib/libcasper/libcasper/libcasper.h	Thu Jan  4 08:23:23 2018	(r327541)
@@ -122,7 +122,15 @@ cap_wrap(int sock)
 #ifdef WITH_CASPER
 int	cap_unwrap(cap_channel_t *chan);
 #else
-#define	cap_unwrap(chan)	(chan->cch_fd)
+static inline int
+cap_unwrap(cap_channel_t *chan)
+{
+	int fd;
+
+	fd = chan->cch_fd;
+	free(chan);
+	return (fd);
+}
 #endif
 
 /*


More information about the svn-src-head mailing list