projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: cleanup inactive FDs in the consumer polling thread
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
main.c
diff --git
a/src/bin/lttng-sessiond/main.c
b/src/bin/lttng-sessiond/main.c
index 3d0a65def51a0a727c3a5d08539c035f341701f5..ea28feecfd0888d644edce7bf4ff70fbe36c0730 100644
(file)
--- a/
src/bin/lttng-sessiond/main.c
+++ b/
src/bin/lttng-sessiond/main.c
@@
-2442,7
+2442,7
@@
static pid_t spawn_consumerd(struct consumer_data *consumer_data)
{
char *tmpnew = NULL;
{
char *tmpnew = NULL;
- if (config.consumerd64_lib_dir.value
[0] != '\0'
) {
+ if (config.consumerd64_lib_dir.value) {
char *tmp;
size_t tmplen;
char *tmp;
size_t tmplen;
@@
-2450,20
+2450,18
@@
static pid_t spawn_consumerd(struct consumer_data *consumer_data)
if (!tmp) {
tmp = "";
}
if (!tmp) {
tmp = "";
}
- tmplen = strlen("LD_LIBRARY_PATH=")
- + strlen(config.consumerd64_lib_dir.value) + 1 /* : */ + strlen(tmp);
+ tmplen = strlen(config.consumerd64_lib_dir.value) + 1 /* : */ + strlen(tmp);
tmpnew = zmalloc(tmplen + 1 /* \0 */);
if (!tmpnew) {
ret = -ENOMEM;
goto error;
}
tmpnew = zmalloc(tmplen + 1 /* \0 */);
if (!tmpnew) {
ret = -ENOMEM;
goto error;
}
- strcpy(tmpnew, "LD_LIBRARY_PATH=");
strcat(tmpnew, config.consumerd64_lib_dir.value);
if (tmp[0] != '\0') {
strcat(tmpnew, ":");
strcat(tmpnew, tmp);
}
strcat(tmpnew, config.consumerd64_lib_dir.value);
if (tmp[0] != '\0') {
strcat(tmpnew, ":");
strcat(tmpnew, tmp);
}
- ret =
putenv(tmpnew
);
+ ret =
setenv("LD_LIBRARY_PATH", tmpnew, 1
);
if (ret) {
ret = -errno;
free(tmpnew);
if (ret) {
ret = -errno;
free(tmpnew);
@@
-2476,16
+2474,14
@@
static pid_t spawn_consumerd(struct consumer_data *consumer_data)
"--consumerd-err-sock", consumer_data->err_unix_sock_path,
"--group", config.tracing_group_name.value,
NULL);
"--consumerd-err-sock", consumer_data->err_unix_sock_path,
"--group", config.tracing_group_name.value,
NULL);
- if (config.consumerd64_lib_dir.value[0] != '\0') {
- free(tmpnew);
- }
+ free(tmpnew);
break;
}
case LTTNG_CONSUMER32_UST:
{
char *tmpnew = NULL;
break;
}
case LTTNG_CONSUMER32_UST:
{
char *tmpnew = NULL;
- if (config.consumerd32_lib_dir.value
[0] != '\0'
) {
+ if (config.consumerd32_lib_dir.value) {
char *tmp;
size_t tmplen;
char *tmp;
size_t tmplen;
@@
-2493,20
+2489,18
@@
static pid_t spawn_consumerd(struct consumer_data *consumer_data)
if (!tmp) {
tmp = "";
}
if (!tmp) {
tmp = "";
}
- tmplen = strlen("LD_LIBRARY_PATH=")
- + strlen(config.consumerd32_lib_dir.value) + 1 /* : */ + strlen(tmp);
+ tmplen = strlen(config.consumerd32_lib_dir.value) + 1 /* : */ + strlen(tmp);
tmpnew = zmalloc(tmplen + 1 /* \0 */);
if (!tmpnew) {
ret = -ENOMEM;
goto error;
}
tmpnew = zmalloc(tmplen + 1 /* \0 */);
if (!tmpnew) {
ret = -ENOMEM;
goto error;
}
- strcpy(tmpnew, "LD_LIBRARY_PATH=");
strcat(tmpnew, config.consumerd32_lib_dir.value);
if (tmp[0] != '\0') {
strcat(tmpnew, ":");
strcat(tmpnew, tmp);
}
strcat(tmpnew, config.consumerd32_lib_dir.value);
if (tmp[0] != '\0') {
strcat(tmpnew, ":");
strcat(tmpnew, tmp);
}
- ret =
putenv(tmpnew
);
+ ret =
setenv("LD_LIBRARY_PATH", tmpnew, 1
);
if (ret) {
ret = -errno;
free(tmpnew);
if (ret) {
ret = -errno;
free(tmpnew);
@@
-2519,13
+2513,11
@@
static pid_t spawn_consumerd(struct consumer_data *consumer_data)
"--consumerd-err-sock", consumer_data->err_unix_sock_path,
"--group", config.tracing_group_name.value,
NULL);
"--consumerd-err-sock", consumer_data->err_unix_sock_path,
"--group", config.tracing_group_name.value,
NULL);
- if (config.consumerd32_lib_dir.value[0] != '\0') {
- free(tmpnew);
- }
+ free(tmpnew);
break;
}
default:
break;
}
default:
-
PERRO
R("unknown consumer type");
+
ER
R("unknown consumer type");
exit(EXIT_FAILURE);
}
if (errno != 0) {
exit(EXIT_FAILURE);
}
if (errno != 0) {
This page took
0.033517 seconds
and
4
git commands to generate.