Changeset View
Changeset View
Standalone View
Standalone View
ps/gscreator.cpp
Show First 20 Lines • Show All 344 Lines • ▼ Show 20 Line(s) | 188 | // | |||
---|---|---|---|---|---|
345 | close(input[1]); | 345 | close(input[1]); | ||
346 | close(output[0]); | 346 | close(output[0]); | ||
347 | close(output[1]); | 347 | close(output[1]); | ||
348 | close(dvipipe[0]); | 348 | close(dvipipe[0]); | ||
349 | 349 | | |||
350 | dup2( dvipipe[1], STDOUT_FILENO); | 350 | dup2( dvipipe[1], STDOUT_FILENO); | ||
351 | 351 | | |||
352 | execvp(dvipsargs[0], const_cast<char *const *>(dvipsargs)); | 352 | execvp(dvipsargs[0], const_cast<char *const *>(dvipsargs)); | ||
353 | exit(1); | 353 | _exit(1); | ||
354 | } | 354 | } | ||
355 | else if(pid_two != -1){ | 355 | else if(pid_two != -1){ | ||
356 | close(input[1]); | 356 | close(input[1]); | ||
357 | close(output[0]); | 357 | close(output[0]); | ||
358 | close(dvipipe[1]); | 358 | close(dvipipe[1]); | ||
359 | 359 | | |||
360 | dup2( dvipipe[0], STDIN_FILENO); | 360 | dup2( dvipipe[0], STDIN_FILENO); | ||
361 | dup2( output[1], STDOUT_FILENO); | 361 | dup2( output[1], STDOUT_FILENO); | ||
362 | 362 | | |||
363 | execvp(gsargs[0], const_cast<char *const *>(gsargs)); | 363 | execvp(gsargs[0], const_cast<char *const *>(gsargs)); | ||
364 | exit(1); | 364 | _exit(1); | ||
365 | } | 365 | } | ||
366 | else{ | 366 | else{ | ||
367 | // fork() (2) failed, close these | 367 | // fork() (2) failed, close these | ||
368 | close(dvipipe[0]); | 368 | close(dvipipe[0]); | ||
369 | close(dvipipe[1]); | 369 | close(dvipipe[1]); | ||
370 | } | 370 | } | ||
371 | 371 | | |||
372 | } | 372 | } | ||
373 | else if( no_dvi ){ | 373 | else if( no_dvi ){ | ||
374 | // Reopen stdin/stdout on the pipes and exec gs | 374 | // Reopen stdin/stdout on the pipes and exec gs | ||
375 | close(input[1]); | 375 | close(input[1]); | ||
376 | close(output[0]); | 376 | close(output[0]); | ||
377 | 377 | | |||
378 | dup2(input[0], STDIN_FILENO); | 378 | dup2(input[0], STDIN_FILENO); | ||
379 | dup2(output[1], STDOUT_FILENO); | 379 | dup2(output[1], STDOUT_FILENO); | ||
380 | 380 | | |||
381 | execvp(gsargs[0], const_cast<char *const *>(gsargs)); | 381 | execvp(gsargs[0], const_cast<char *const *>(gsargs)); | ||
382 | exit(1); | 382 | _exit(1); | ||
383 | } | 383 | } | ||
384 | } | 384 | } | ||
385 | else if (pid != -1) { | 385 | else if (pid != -1) { | ||
386 | // Parent process, write first-page-only-hack (the hack is not | 386 | // Parent process, write first-page-only-hack (the hack is not | ||
387 | // used if DVI) and read the png output | 387 | // used if DVI) and read the png output | ||
388 | close(input[0]); | 388 | close(input[0]); | ||
389 | close(output[1]); | 389 | close(output[1]); | ||
390 | const char *prolog; | 390 | const char *prolog; | ||
▲ Show 20 Lines • Show All 248 Lines • Show Last 20 Lines |