X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=converter%2Fbabeltrace-log.c;h=c478b004d71cf1ecf844c339db46db6fa912c3eb;hp=b724ccd67ebd5aecbb26d671d2e858e2d978b533;hb=ccce44e83614322e21e6a90f271c7b89824fb968;hpb=72a3bc16d8ecc59e593f5cfec4622cbc7fb2f3fc diff --git a/converter/babeltrace-log.c b/converter/babeltrace-log.c index b724ccd6..c478b004 100644 --- a/converter/babeltrace-log.c +++ b/converter/babeltrace-log.c @@ -24,17 +24,13 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. - * - * Depends on glibc 2.10 for getline(). */ -#define _GNU_SOURCE -#include #include #include #include #include -#include +#include #include #include #include @@ -47,6 +43,7 @@ #include #include #include +#include #include #define NSEC_PER_USEC 1000UL @@ -285,7 +282,8 @@ void trace_string(char *line, struct ctf_stream_pos *pos, size_t len) if (!ctf_move_pos(&dummy, tlen * CHAR_BIT)) packet_filled = 1; if (packet_filled || ctf_pos_packet(&dummy)) { - ctf_pos_pad_packet(pos); + if (ctf_pos_pad_packet(pos)) + goto error; write_packet_header(pos, s_uuid); write_packet_context(pos); if (attempt++ == 1) { @@ -318,7 +316,7 @@ void trace_text(FILE *input, int output) struct ctf_stream_pos pos; ssize_t len; char *line = NULL, *nl; - size_t linesize; + size_t linesize = 0; int ret; memset(&pos, 0, sizeof(pos)); @@ -331,7 +329,7 @@ void trace_text(FILE *input, int output) write_packet_header(&pos, s_uuid); write_packet_context(&pos); for (;;) { - len = getline(&line, &linesize, input); + len = bt_getline(&line, &linesize, input); if (len < 0) break; nl = strrchr(line, '\n'); @@ -415,7 +413,7 @@ int main(int argc, char **argv) perror("opendir"); goto error_rmdir; } - dir_fd = dirfd(dir); + dir_fd = bt_dirfd(dir); if (dir_fd < 0) { perror("dirfd"); goto error_closedir;