From 42e99028d61b9ebf5d2a250fc99db0ec4941204a Mon Sep 17 00:00:00 2001 From: compudj Date: Thu, 23 Jul 2009 19:34:54 +0000 Subject: [PATCH] fix lttd append git-svn-id: http://ltt.polymtl.ca/svn@3419 04897980-b3bd-0310-b5e0-8ef037075253 --- trunk/ltt-control/configure.in | 2 +- trunk/ltt-control/lttd/lttd.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/trunk/ltt-control/configure.in b/trunk/ltt-control/configure.in index 846d332..6adcbaa 100644 --- a/trunk/ltt-control/configure.in +++ b/trunk/ltt-control/configure.in @@ -23,7 +23,7 @@ AC_PREREQ(2.57) AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS) #AC_WITH_LTDL # not needed ? -AM_INIT_AUTOMAKE(ltt-control,0.68-19062009) +AM_INIT_AUTOMAKE(ltt-control,0.69-23072009) AM_CONFIG_HEADER(config.h) AM_PROG_LIBTOOL diff --git a/trunk/ltt-control/lttd/lttd.c b/trunk/ltt-control/lttd/lttd.c index ceae377..f21c411 100644 --- a/trunk/ltt-control/lttd/lttd.c +++ b/trunk/ltt-control/lttd/lttd.c @@ -316,12 +316,16 @@ int open_buffer_file(char *filename, char *path_channel, char *path_trace, path_trace); fd_pairs->pair[fd_pairs->num_pairs-1].trace = - open(path_trace, O_WRONLY|O_APPEND, + open(path_trace, O_WRONLY, S_IRWXU|S_IRWXG|S_IRWXO); - if(fd_pairs->pair[fd_pairs->num_pairs-1].trace == -1) { perror(path_trace); } + ret = lseek(fd_pairs->pair[fd_pairs->num_pairs-1].trace, + 0, SEEK_END); + if (ret < 0) { + perror(path_trace); + } } else { printf("File %s exists, cannot open. Try append mode.\n", path_trace); open_ret = -1; -- 2.34.1