Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
vcl: basic support for apps that fork
[vpp.git]
/
src
/
vcl
/
ldp.c
diff --git
a/src/vcl/ldp.c
b/src/vcl/ldp.c
index
5c70643
..
915d1ca
100644
(file)
--- a/
src/vcl/ldp.c
+++ b/
src/vcl/ldp.c
@@
-346,7
+346,7
@@
ldp_init (void)
int
close (int fd)
{
int
close (int fd)
{
- int rv;
+ int rv
, refcnt
;
const char *func_str;
u32 sid = ldp_sid_from_fd (fd);
const char *func_str;
u32 sid = ldp_sid_from_fd (fd);
@@
-388,13
+388,15
@@
close (int fd)
LDBG (0, "LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
LDBG (0, "LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
+ refcnt = vppcom_session_attr (sid, VPPCOM_ATTR_GET_REFCNT, 0, 0);
rv = vppcom_session_close (sid);
if (rv != VPPCOM_OK)
{
errno = -rv;
rv = -1;
}
rv = vppcom_session_close (sid);
if (rv != VPPCOM_OK)
{
errno = -rv;
rv = -1;
}
- ldp_fd_free_w_sid (sid);
+ if (refcnt == 1)
+ ldp_fd_free_w_sid (sid);
}
else
{
}
else
{