libDtSvc: Resolve 28 compiler warnings.

This commit is contained in:
Peter Howkins
2015-01-14 14:10:55 +00:00
parent 49266f9019
commit 5c8f66a07d
12 changed files with 31 additions and 19 deletions

View File

@@ -951,13 +951,19 @@ _DtCmdCommandInvokerExecute (
* Save the current directory and then "chdir" to the directory
* to do the execution. If the chdir fails, return.
*/
(void) getcwd (tmpDir, MAXPATHLEN);
if(NULL == getcwd (tmpDir, MAXPATHLEN))
{
perror(strerror(errno));
return (_CMD_EXECUTE_FAILURE);
}
if (!_DtCmdValidDir (_cmdClientHost, contextDir, contextHost))
{
Cmd_FreeAllocatedStringVector (commandArray);
(void) sprintf (errorMessage, errorChdir, contextDir, execHost);
(void) chdir (tmpDir);
if(-1 == chdir (tmpDir)) {
perror(strerror(errno));
}
return (_CMD_EXECUTE_FAILURE);
}
@@ -981,7 +987,9 @@ _DtCmdCommandInvokerExecute (
if (commandPid < 0)
{
Cmd_FreeAllocatedStringVector (commandArray);
(void) chdir (tmpDir);
if(-1 == chdir (tmpDir)) {
perror(strerror(errno));
}
(void) sprintf(errorMessage, errorFork, execHost);
(void) _DtEnvControl (DT_ENV_RESTORE_POST_DT);
return (_CMD_EXECUTE_FAILURE);