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
diff --git a/coregrind/m_errormgr.c b/coregrind/m_errormgr.c
index 11e7acb..50e1ab2 100644
--- a/coregrind/m_errormgr.c
+++ b/coregrind/m_errormgr.c
@@ -895,22 +895,25 @@
static void load_one_suppressions_file ( Char* filename )
{
# define N_BUF 200
- Int fd, i;
- Bool eof;
- Char buf[N_BUF+1];
- Char* tool_names;
- Char* supp_name;
- Char* err_str = NULL;
+ SysRes sres;
+ Int fd, i;
+ Bool eof;
+ Char buf[N_BUF+1];
+ Char* tool_names;
+ Char* supp_name;
+ Char* err_str = NULL;
SuppLoc tmp_callers[VG_MAX_SUPP_CALLERS];
- fd = VG_(open)( filename, VKI_O_RDONLY, 0 );
- if (fd < 0) {
+ fd = -1;
+ sres = VG_(open)( filename, VKI_O_RDONLY, 0 );
+ if (sres.isError) {
VG_(message)(Vg_UserMsg, "FATAL: can't open suppressions file '%s'",
filename );
VG_(exit)(1);
}
+ fd = sres.val;
-#define BOMB(S) { err_str = S; goto syntax_error; }
+# define BOMB(S) { err_str = S; goto syntax_error; }
while (True) {
/* Assign and initialise the two suppression halves (core and tool) */