projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
port: add support for BSD mktemp
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
notify-apps.cpp
diff --git
a/src/bin/lttng-sessiond/notify-apps.cpp
b/src/bin/lttng-sessiond/notify-apps.cpp
index 80c7fb143f06d0e88768428cd392ad4c602122d6..1b83491d14b920686898a77a0f249bda42223520 100644
(file)
--- a/
src/bin/lttng-sessiond/notify-apps.cpp
+++ b/
src/bin/lttng-sessiond/notify-apps.cpp
@@
-18,22
+18,24
@@
#include "utils.hpp"
#include "thread.hpp"
#include "utils.hpp"
#include "thread.hpp"
+namespace {
struct thread_notifiers {
struct lttng_pipe *quit_pipe;
int apps_cmd_notify_pipe_read_fd;
};
struct thread_notifiers {
struct lttng_pipe *quit_pipe;
int apps_cmd_notify_pipe_read_fd;
};
+} /* namespace */
/*
* This thread manage application notify communication.
*/
static void *thread_application_notification(void *data)
{
/*
* This thread manage application notify communication.
*/
static void *thread_application_notification(void *data)
{
- int i, ret,
pollfd,
err = -1;
+ int i, ret, err = -1;
ssize_t size_ret;
ssize_t size_ret;
- uint32_t
revents,
nb_fd;
+ uint32_t nb_fd;
struct lttng_poll_event events;
struct thread_notifiers *notifiers = (thread_notifiers *) data;
struct lttng_poll_event events;
struct thread_notifiers *notifiers = (thread_notifiers *) data;
- const
int quit_pipe_read
_fd = lttng_pipe_get_readfd(notifiers->quit_pipe);
+ const
auto thread_quit_pipe
_fd = lttng_pipe_get_readfd(notifiers->quit_pipe);
DBG("[ust-thread] Manage application notify command");
DBG("[ust-thread] Manage application notify command");
@@
-61,7
+63,7
@@
static void *thread_application_notification(void *data)
goto error;
}
goto error;
}
- ret = lttng_poll_add(&events,
quit_pipe_read
_fd,
+ ret = lttng_poll_add(&events,
thread_quit_pipe
_fd,
LPOLLIN | LPOLLERR);
if (ret < 0) {
goto error;
LPOLLIN | LPOLLERR);
if (ret < 0) {
goto error;
@@
-95,14
+97,17
@@
restart:
health_code_update();
/* Fetch once the poll data */
health_code_update();
/* Fetch once the poll data */
- revents = LTTNG_POLL_GETEV(&events, i);
- pollfd = LTTNG_POLL_GETFD(&events, i);
+
const auto
revents = LTTNG_POLL_GETEV(&events, i);
+
const auto
pollfd = LTTNG_POLL_GETFD(&events, i);
- /* Thread quit pipe has been closed. Killing thread. */
- if (pollfd == quit_pipe_read_fd) {
+ /* Activity on thread quit pipe, exiting. */
+ if (pollfd == thread_quit_pipe_fd) {
+ DBG("Activity on thread quit pipe");
err = 0;
goto exit;
err = 0;
goto exit;
- } else if (pollfd == notifiers->apps_cmd_notify_pipe_read_fd) {
+ }
+
+ if (pollfd == notifiers->apps_cmd_notify_pipe_read_fd) {
/* Inspect the apps cmd pipe */
int sock;
/* Inspect the apps cmd pipe */
int sock;
This page took
0.024789 seconds
and
4
git commands to generate.