Rev 8149 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8149 | Rev 8195 | ||
---|---|---|---|
Line 17... | Line 17... | ||
17 | 17 | ||
18 | /* dvi 2 gif driver, tex standard */ |
18 | /* dvi 2 gif driver, tex standard */ |
19 | 19 | ||
20 | #include "texgif.h" |
20 | #include "texgif.h" |
21 | 21 | ||
22 | void |
22 | void texgif_error(char *s) |
23 | { |
23 | { |
24 | fprintf(stderr,"%s: %s\n",progname, s); |
24 | fprintf(stderr,"%s: %s\n",progname, s); |
25 | exit(1); |
25 | exit(1); |
26 | } |
26 | } |
27 | 27 | ||
Line 77... | Line 77... | ||
77 | fflush(NULL); /* flush all output streams before forking |
77 | fflush(NULL); /* flush all output streams before forking |
78 | * otherwise they will be doubled */ |
78 | * otherwise they will be doubled */ |
79 | pid=fork(); if(pid==-1) return -1; |
79 | pid=fork(); if(pid==-1) return -1; |
80 | if(!pid) { /* child */ |
80 | if(!pid) { /* child */ |
81 | if(inf!=NULL && freopen(inf,"r",stdin) == NULL) |
81 | if(inf!=NULL && freopen(inf,"r",stdin) == NULL) |
82 |
|
82 | texgif_error("freopen failure"); |
83 | if(outf!=NULL && freopen(outf,"w",stdout)) |
83 | if(outf!=NULL && freopen(outf,"w",stdout)) |
84 |
|
84 | texgif_error("freopen failure"); |
85 | if(errf!=NULL && freopen(errf,"w",stderr)) |
85 | if(errf!=NULL && freopen(errf,"w",stderr)) |
86 |
|
86 | texgif_error("freopen failure"); |
87 | if(wrapexec) { |
87 | if(wrapexec) { |
88 | setreuid(getuid(),getuid());setregid(getgid(),getgid()); |
88 | setreuid(getuid(),getuid());setregid(getgid(),getgid()); |
89 | } |
89 | } |
90 | if(strchr(cmdf,'/')) execv(cmdf,arg); |
90 | if(strchr(cmdf,'/')) execv(cmdf,arg); |
91 | else execvp(cmdf,arg); |
91 | else execvp(cmdf,arg); |