summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testshl2/source/dynamicregister.cxx6
-rw-r--r--testshl2/source/terminate.cxx8
2 files changed, 10 insertions, 4 deletions
diff --git a/testshl2/source/dynamicregister.cxx b/testshl2/source/dynamicregister.cxx
index 02fb05871303..801e7702ab65 100644
--- a/testshl2/source/dynamicregister.cxx
+++ b/testshl2/source/dynamicregister.cxx
@@ -46,14 +46,14 @@
namespace fixes
{
- void changedir(const char* _sPath)
+ int changedir(const char* _sPath)
{
#if defined(WIN32)
// chdir(_sPath) is marked depricated since Visual C++ 2005
// use _chdir instead
- ::_chdir(_sPath);
+ return ::_chdir(_sPath);
#else
- ::chdir(_sPath);
+ return ::chdir(_sPath);
#endif
}
}
diff --git a/testshl2/source/terminate.cxx b/testshl2/source/terminate.cxx
index 3db99d55d43a..b2dc95b0e860 100644
--- a/testshl2/source/terminate.cxx
+++ b/testshl2/source/terminate.cxx
@@ -116,7 +116,13 @@ int ProcessHandler::readPIDFromFile()
// exit(0);
}
// if file exist, wait short, maybe the other tool writes it down.
- fscanf(in, "%d", &nPID);
+ if (fscanf(in, "%d", &nPID) != 1)
+ {
+ // fprintf(stderr, "warning: (testshl.cxx) can't read own pid.\n");
+ fclose(in);
+ return 0;
+ // exit(0);
+ }
fclose(in);
}
else