projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: warning 'fd' may be used uninitialized
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
save.c
diff --git
a/src/bin/lttng-sessiond/save.c
b/src/bin/lttng-sessiond/save.c
index 3c6b5b8a01931540cbd050a9600f969e0076b471..c51338e1758c519a19710ed0334699e9f1af04eb 100644
(file)
--- a/
src/bin/lttng-sessiond/save.c
+++ b/
src/bin/lttng-sessiond/save.c
@@
-215,13
+215,13
@@
const char *get_kernel_instrumentation_string(
instrumentation_string = config_event_type_tracepoint;
break;
case LTTNG_KERNEL_KPROBE:
instrumentation_string = config_event_type_tracepoint;
break;
case LTTNG_KERNEL_KPROBE:
- instrumentation_string = config_event_type_
k
probe;
+ instrumentation_string = config_event_type_probe;
break;
case LTTNG_KERNEL_FUNCTION:
break;
case LTTNG_KERNEL_FUNCTION:
- instrumentation_string = config_event_type_function;
+ instrumentation_string = config_event_type_function
_entry
;
break;
case LTTNG_KERNEL_KRETPROBE:
break;
case LTTNG_KERNEL_KRETPROBE:
- instrumentation_string = config_event_type_
kretprobe
;
+ instrumentation_string = config_event_type_
function
;
break;
case LTTNG_KERNEL_NOOP:
instrumentation_string = config_event_type_noop;
break;
case LTTNG_KERNEL_NOOP:
instrumentation_string = config_event_type_noop;
@@
-1890,8
+1890,7
@@
static
int save_session(struct ltt_session *session,
struct lttng_save_session_attr *attr, lttng_sock_cred *creds)
{
int save_session(struct ltt_session *session,
struct lttng_save_session_attr *attr, lttng_sock_cred *creds)
{
- int ret, fd;
- unsigned int file_opened = 0; /* Indicate if the file has been opened */
+ int ret, fd = -1;
char config_file_path[PATH_MAX];
size_t len;
struct config_writer *writer = NULL;
char config_file_path[PATH_MAX];
size_t len;
struct config_writer *writer = NULL;
@@
-1984,7
+1983,6
@@
int save_session(struct ltt_session *session,
ret = LTTNG_ERR_SAVE_IO_FAIL;
goto end;
}
ret = LTTNG_ERR_SAVE_IO_FAIL;
goto end;
}
- file_opened = 1;
writer = config_writer_create(fd, 1);
if (!writer) {
writer = config_writer_create(fd, 1);
if (!writer) {
@@
-2089,12
+2087,12
@@
end:
}
if (ret) {
/* Delete file in case of error */
}
if (ret) {
/* Delete file in case of error */
- if (
file_opened
&& unlink(config_file_path)) {
+ if (
(fd >= 0)
&& unlink(config_file_path)) {
PERROR("Unlinking XML session configuration.");
}
}
PERROR("Unlinking XML session configuration.");
}
}
- if (f
ile_opened
) {
+ if (f
d >= 0
) {
ret = close(fd);
if (ret) {
PERROR("Closing XML session configuration");
ret = close(fd);
if (ret) {
PERROR("Closing XML session configuration");
This page took
0.027084 seconds
and
4
git commands to generate.