Changeset 3371 in Sophya
- Timestamp:
- Oct 31, 2007, 11:50:01 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/ProgPI/piapp.cc
r3146 r3371 57 57 [-tmpdir TmpDirectory] [-help2tex] [-exec file [args]] 58 58 -nored : Don't redirect stdout/stderr to piapp console 59 -doublered : Redirect stdout/stderr to piapp console AND the terminal 59 60 -termread : Read commands on terminal (stdin) 60 61 -term : equivalent to -nored -termread -small … … 83 84 << " [-tmpdir TmpDirectory] [-help2tex] [-exec file [args]] \n" 84 85 << " -nored : Don't redirect stdout/stderr to piapp console\n" 86 << " -doublered : Redirect stdout/stderr to piapp console AND the terminal \n" 85 87 << " -termread : Read commands on terminal (stdin)\n" 86 88 << " -term : equivalent to -nored -termread -small \n" … … 102 104 { 103 105 int ofa; 104 bool fgfpe, fgsegv, fgred, fghidezsw, fgexec, fgsmall, fgtermrd; 106 bool fgfpe, fgsegv, fghidezsw, fgexec, fgsmall, fgtermrd; 107 RED_OUTERR_FLG fgred = CONSRED_OE; 105 108 106 109 SkyTInitiator skyinit; … … 112 115 113 116 ofa = 1; 114 fgred = fgfpe = fgsegv = true; 117 fgred = CONSRED_OE; 118 fgfpe = fgsegv = true; 115 119 fghidezsw = false; 116 120 fgexec = false; … … 124 128 int ka; 125 129 for(ka=1; ka<narg; ka++) { 126 if (strcmp(arg[ka],"-nored") == 0) fgred=false; 130 if (strcmp(arg[ka],"-nored") == 0) fgred=NORED_OE; 131 else if (strcmp(arg[ka],"-doublered") == 0) fgred=DOUBLERED_OE; 127 132 else if (strcmp(arg[ka],"-nosig") == 0) fgfpe=fgsegv=false; 128 133 else if (strcmp(arg[ka],"-termread") == 0) fgtermrd=true; 129 134 else if (strcmp(arg[ka],"-term") == 0) 130 { fgred= false; fgtermrd=true; fgsmall=true; }135 { fgred=NORED_OE; fgtermrd=true; fgsmall=true; } 131 136 else if (strcmp(arg[ka],"-nosigfpe") == 0) fgfpe=false; 132 137 else if (strcmp(arg[ka],"-nosigsegv") == 0) fgsegv=false; 133 138 else if (strcmp(arg[ka],"-small") == 0) fgsmall=true; 134 139 else if (strcmp(arg[ka],"-hidezswin") == 0) fghidezsw=true; 135 else if (strcmp(arg[ka],"-help2tex") == 0) { fgtexh=true; fgred= false; }140 else if (strcmp(arg[ka],"-help2tex") == 0) { fgtexh=true; fgred=NORED_OE; } 136 141 else if (strcmp(arg[ka],"-tmpdir") == 0) { 137 142 if (ka == narg-1) return Usage(true); … … 198 203 199 204 // Gestion de redirection stdout/err et Signaux 200 if (fgred) app->RedirectStdOutErr(true); 201 else app->RedirectStdOutErr(false); 205 app->RedirectStdOutErr(fgred); 202 206 app->CatchSignals(fgfpe, fgsegv); 203 207 … … 238 242 rc = 0; cont = false; 239 243 app->SetReady(); 240 if (fgred) app->RedirectStdOutErr(true);244 app->RedirectStdOutErr(fgred); 241 245 try { 242 246 app->Run(); … … 244 248 catch(PThrowable exc) { // Catching SOPHYA exceptions 245 249 app->Stop(); 246 app->RedirectStdOutErr( false);250 app->RedirectStdOutErr(NORED_OE); 247 251 //BUG ? fait planter OSF-cxx fflush(stdout); 248 252 cout << endl; cerr << endl; … … 268 272 catch(...) { // Catching all other exceptions 269 273 app->Stop(); 270 app->RedirectStdOutErr( false);274 app->RedirectStdOutErr(NORED_OE); 271 275 cout << endl; cerr << endl; 272 276 cout << "\n piapp/main() exception catched ! " << endl; … … 292 296 cout << "\n ------------------------------------------------ \n" 293 297 << " piapp: Cleaning up ... " << endl; 294 295 app->RedirectStdOutErr(false); 298 app->RedirectStdOutErr(NORED_OE); 299 cout << "\n ------------------------------------------------ \n" 300 << " piapp: Exiting - Cleaning up ... " << endl; 301 296 302 // -- ca fait planter sur linux -- Reza 04/2006 if (fgtermrd) cmdrdr.cancel(); 297 303
Note:
See TracChangeset
for help on using the changeset viewer.