diff options
author | Alejandro Conty Estevez <conty@yafray.org> | 2004-01-19 21:36:53 +0300 |
---|---|---|
committer | Alejandro Conty Estevez <conty@yafray.org> | 2004-01-19 21:36:53 +0300 |
commit | 033a16e258721627808b16d2172d3bae80d4f9fa (patch) | |
tree | 9b54e2ea0a28d78fa3ab0c6e4776563943c5ae56 /source/blender/yafray | |
parent | f7d5c46e53ccbec45cec9b22079a4a9146c9eef1 (diff) |
Error checking in system call.
Diffstat (limited to 'source/blender/yafray')
-rwxr-xr-x | source/blender/yafray/intern/export_File.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/source/blender/yafray/intern/export_File.cpp b/source/blender/yafray/intern/export_File.cpp index f90a74eb0a0..bcc34be2487 100755 --- a/source/blender/yafray/intern/export_File.cpp +++ b/source/blender/yafray/intern/export_File.cpp @@ -1214,7 +1214,23 @@ bool yafrayFileRender_t::executeYafray(const string &xmlpath) char yfr[8]; sprintf(yfr, "%d ", R.r.YF_numprocs); string command = command_path + "yafray -c " + yfr + "\"" + xmlpath + "\""; - return system(command.c_str())==0; + int ret=system(command.c_str()); + if(WIFEXITED(ret)) + { + if(WEXITSTATUS(ret)) cout<<"Executed -"<<command<<"-"<<endl; + switch(WEXITSTATUS(ret)) + { + case 0: cout<<"Yafray completed successfully\n";return true; + case 127: cout<<"Yafray not found\n";return false; + case 126: cout<<"Yafray: permission denied\n";return false; + default: cout<<"Yafray exited with errors\n";return false; + } + } + else if(WIFSIGNALED(ret)) + cout<<"Yafray crashed\n"; + else + cout<<"Unknown error\n"; + return false; } |