summaryrefslogtreecommitdiff
path: root/cachegrind
diff options
context:
space:
mode:
authorsewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9>2005-07-23 09:18:34 +0000
committersewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9>2005-07-23 09:18:34 +0000
commit9264559eba4aa5d397a278b4e1a50c03de30693f (patch)
tree29396f4855cfd519a12ae5774b15cab6f8dea3c8 /cachegrind
parent2af58f27aa3d05dfd31613c9c61971cb7879c94a (diff)
A commit which is almost all trivial change.
- m_main: if --log-file-qualifier applies, do not add ".pid" at the end of the name - Fix the logic which detected whether the just-devised name already existed. This was broken (by me) because it could not distinguish the reasons for failing to open the logfile. Doing this required changing the return type of VG_(open) from Int to SysRes (to make failure reasons visible) and that's the cause of most of the changes. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4228 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'cachegrind')
-rw-r--r--cachegrind/cg_main.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/cachegrind/cg_main.c b/cachegrind/cg_main.c
index 4f0bef44..73d05a44 100644
--- a/cachegrind/cg_main.c
+++ b/cachegrind/cg_main.c
@@ -807,6 +807,7 @@ static void fprint_lineCC(Int fd, lineCC* n)
static void fprint_CC_table_and_calc_totals(void)
{
Int fd;
+ SysRes sres;
Char buf[512];
fileCC *curr_fileCC;
fnCC *curr_fnCC;
@@ -815,9 +816,9 @@ static void fprint_CC_table_and_calc_totals(void)
VGP_PUSHCC(VgpCacheResults);
- fd = VG_(open)(cachegrind_out_file, VKI_O_CREAT|VKI_O_TRUNC|VKI_O_WRONLY,
- VKI_S_IRUSR|VKI_S_IWUSR);
- if (fd < 0) {
+ sres = VG_(open)(cachegrind_out_file, VKI_O_CREAT|VKI_O_TRUNC|VKI_O_WRONLY,
+ VKI_S_IRUSR|VKI_S_IWUSR);
+ if (sres.isError) {
// If the file can't be opened for whatever reason (conflict
// between multiple cachegrinded processes?), give up now.
VG_(message)(Vg_UserMsg,
@@ -826,6 +827,8 @@ static void fprint_CC_table_and_calc_totals(void)
VG_(message)(Vg_UserMsg,
" ... so simulation results will be missing.");
return;
+ } else {
+ fd = sres.val;
}
// "desc:" lines (giving I1/D1/L2 cache configuration). The spaces after