projects
/
deliverable
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: liblttng-ctl comm: lttng_event is not packed
[deliverable/lttng-tools.git]
/
src
/
common
/
userspace-probe.c
diff --git
a/src/common/userspace-probe.c
b/src/common/userspace-probe.c
index a15e5b7e42480fd50484c039a1722791536f313f..e85c3c56fc67eea6163b5442694a1855332892ad 100644
(file)
--- a/
src/common/userspace-probe.c
+++ b/
src/common/userspace-probe.c
@@
-413,17
+413,20
@@
lttng_userspace_probe_location_function_copy(
goto error;
}
goto error;
}
- /* Duplicate the binary fd */
+ /*
+ * Duplicate the binary fd if possible. The binary fd can be -1 on
+ * listing
+ */
fd = lttng_userspace_probe_location_function_get_binary_fd(location);
fd = lttng_userspace_probe_location_function_get_binary_fd(location);
- if (fd
==
-1) {
-
ERR("Error getting file descriptor to binary"
);
- goto error;
- }
-
- new_fd = dup(fd);
-
if (new_fd == -1)
{
- PERROR("Error duplicating file descriptor to binary");
-
goto error
;
+ if (fd
>
-1) {
+
new_fd = dup(fd
);
+ if (new_fd == -1) {
+ PERROR("Error duplicating file descriptor to binary");
+ goto error;
+ }
+
} else
{
+ /* The original fd is not set. */
+
new_fd = -1
;
}
/*
}
/*
@@
-509,15
+512,15
@@
lttng_userspace_probe_location_tracepoint_copy(
/* Duplicate the binary fd */
fd = lttng_userspace_probe_location_tracepoint_get_binary_fd(location);
/* Duplicate the binary fd */
fd = lttng_userspace_probe_location_tracepoint_get_binary_fd(location);
- if (fd
==
-1) {
-
ERR("Error getting file descriptor to binary"
);
- goto error;
- }
-
- new_fd = dup(fd);
-
if (new_fd == -1)
{
- PERROR("Error duplicating file descriptor to binary");
-
goto error
;
+ if (fd
>
-1) {
+
new_fd = dup(fd
);
+ if (new_fd == -1) {
+ PERROR("Error duplicating file descriptor to binary");
+ goto error;
+ }
+
} else
{
+ /* The original fd is not set. */
+
new_fd = -1
;
}
/*
}
/*
This page took
0.027743 seconds
and
5
git commands to generate.