Update of /cvsroot/fura/FuraSrc/IGAgent/common/src
In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv8372/FuraSrc/IGAgent/common/src
Modified Files:
ActivityLauncher.cpp ProcessLauncher.cpp
Log Message:
cvssync-20080903232636
Index: ActivityLauncher.cpp
===================================================================
RCS file: /cvsroot/fura/FuraSrc/IGAgent/common/src/ActivityLauncher.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ActivityLauncher.cpp 16 Jul 2008 06:55:00 -0000 1.2
--- ActivityLauncher.cpp 3 Sep 2008 21:27:13 -0000 1.3
***************
*** 101,105 ****
inputData->actualData = data;
inputData->activityName = activityName;
! inputData->processPriority = priority;
inputData->launcherData = launcherData;
--- 101,105 ----
inputData->actualData = data;
inputData->activityName = activityName;
! inputData->processPriority = convertPriority(priority);
inputData->launcherData = launcherData;
***************
*** 271,287 ****
/**
* @brief Converts the priority value in something understandable by the OS.
! *
* @param priority the priority to convert
*
! * @returns the OS-readable value for the thread priority
*/
! int ActivityLauncher::convertThreadPriority(int priority) {
#ifdef WIN32
if(priority == ActivityData::HIGH_PRIORITY) {
! return THREAD_PRIORITY_ABOVE_NORMAL;
} else if(priority == ActivityData::NORMAL_PRIORITY) {
! return THREAD_PRIORITY_NORMAL;
} else if(priority == ActivityData::LOW_PRIORITY) {
! return THREAD_PRIORITY_BELOW_NORMAL;
}
return priority;
--- 271,287 ----
/**
* @brief Converts the priority value in something understandable by the OS.
! *
* @param priority the priority to convert
*
! * @returns the OS-readable value for the priority
*/
! int ActivityLauncher::convertPriority(int priority) {
#ifdef WIN32
if(priority == ActivityData::HIGH_PRIORITY) {
! return HIGH_PRIORITY_CLASS;
} else if(priority == ActivityData::NORMAL_PRIORITY) {
! return NORMAL_PRIORITY_CLASS;
} else if(priority == ActivityData::LOW_PRIORITY) {
! return IDLE_PRIORITY_CLASS;
}
return priority;
Index: ProcessLauncher.cpp
===================================================================
RCS file: /cvsroot/fura/FuraSrc/IGAgent/common/src/ProcessLauncher.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ProcessLauncher.cpp 16 Jul 2008 06:55:00 -0000 1.2
--- ProcessLauncher.cpp 3 Sep 2008 21:27:13 -0000 1.3
***************
*** 74,82 ****
string dirToChange = executeTaskInput->workingDir;
- // Change to the working dir
- if(!FileManager::changeDir(dirToChange)) {
- TOLOG(-1, "::executeProcess: Unable to change to : " << dirToChange);
- }
-
//////
// Compose the command line, including redirections
--- 74,77 ----
***************
*** 103,106 ****
--- 98,106 ----
apr_pool_t* mp = activityInput->activityPool;
+ // Change to the working dir
+ if(!FileManager::changeDir(dirToChange)) {
+ TOLOG(-1, "::executeProcess: Unable to change to : " << dirToChange);
+ }
+
/* prepare process attribute */
if ((rv = apr_procattr_create(&pattr, mp)) != APR_SUCCESS) {
***************
*** 162,166 ****
progname = extendedCommand.c_str();
#endif
-
int argc = 0;
const char* argv[APP_MAX_ARGC];
--- 162,165 ----
***************
*** 173,176 ****
--- 172,176 ----
//cout << "Extended command: " << extendedCommand << endl;
+ TOLOG(2, "::executeProcess: currentDir is " << FileManager::currentDir());
if ((rv = apr_proc_create(&proc, progname, (const char* const*)argv,
NULL, (apr_procattr_t*)pattr, mp)) != APR_SUCCESS) {
***************
*** 179,184 ****
#ifdef WIN32
! // Set the thread priority
! if(!SetThreadPriority(proc.hproc, ActivityLauncher::convertThreadPriority(activityInput->processPriority))) {
TOLOG(-1, "::executeProcess: Error setting process priority: " <<
GetLastError());
--- 179,184 ----
#ifdef WIN32
! // Set the process priority
! if(!SetPriorityClass(proc.hproc, activityInput->processPriority)) {
TOLOG(-1, "::executeProcess: Error setting process priority: " <<
GetLastError());
***************
*** 232,240 ****
}
- // Return to the previous directory
- if(!FileManager::changeDir(currentDir)) {
- TOLOG(-1, "executeProcess: Unable to change to : " << currentDir);
- }
-
//necessary for status files
globalSharedData->hasExecutionFinished = true;
--- 232,235 ----
|