projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: memstream compat layer requires use of babeltrace_close_memstream
[babeltrace.git]
/
formats
/
lttng-live
/
lttng-live-comm.c
diff --git
a/formats/lttng-live/lttng-live-comm.c
b/formats/lttng-live/lttng-live-comm.c
index 485dabba376cf67351b659edef18726770f6fdb2..8509377c271014e2b7d0a27328e419ce66f08698 100644
(file)
--- a/
formats/lttng-live/lttng-live-comm.c
+++ b/
formats/lttng-live/lttng-live-comm.c
@@
-26,7
+26,6
@@
#include <netinet/in.h>
#include <netdb.h>
#include <stdio.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdio.h>
-#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
@@
-53,6
+52,7
@@
#include <babeltrace/compat/memstream.h>
#include <babeltrace/compat/send.h>
#include <babeltrace/compat/memstream.h>
#include <babeltrace/compat/send.h>
+#include <babeltrace/compat/string.h>
#include "lttng-live.h"
#include "lttng-viewer-abi.h"
#include "lttng-live.h"
#include "lttng-viewer-abi.h"
@@
-278,8
+278,8
@@
void update_session_list(GPtrArray *session_list, char *hostname,
return;
relay_session = g_new0(struct lttng_live_relay_session, 1);
return;
relay_session = g_new0(struct lttng_live_relay_session, 1);
- relay_session->hostname = strndup(hostname, MAXNAMLEN);
- relay_session->name = strndup(session_name, MAXNAMLEN);
+ relay_session->hostname =
bt_
strndup(hostname, MAXNAMLEN);
+ relay_session->name =
bt_
strndup(session_name, MAXNAMLEN);
relay_session->clients = clients;
relay_session->streams = streams;
relay_session->timer = timer;
relay_session->clients = clients;
relay_session->streams = streams;
relay_session->timer = timer;
@@
-932,8
+932,10
@@
int get_new_metadata(struct lttng_live_ctx *ctx,
}
} while (ret > 0 || !len_read);
}
} while (ret > 0 || !len_read);
- if (fclose(metadata_stream->metadata_fp_write))
- perror("fclose");
+ if (babeltrace_close_memstream(metadata_buf, &size,
+ metadata_stream->metadata_fp_write)) {
+ perror("babeltrace_close_memstream");
+ }
metadata_stream->metadata_fp_write = NULL;
error:
metadata_stream->metadata_fp_write = NULL;
error:
@@
-1118,7
+1120,7
@@
int handle_seek_position(size_t index, int whence,
struct ctf_stream_pos *pos,
struct ctf_file_stream *file_stream)
{
struct ctf_stream_pos *pos,
struct ctf_file_stream *file_stream)
{
- int ret;
+ int ret
= 0
;
switch (whence) {
case SEEK_CUR:
switch (whence) {
case SEEK_CUR:
This page took
0.024804 seconds
and
4
git commands to generate.