Rev 8195 | Rev 8849 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8195 | Rev 8342 | ||
---|---|---|---|
Line 50... | Line 50... | ||
50 | t=strlen(buf); |
50 | t=strlen(buf); |
51 | snprintf(buf+t,sizeof(buf)-t," %s",arg[k]); |
51 | snprintf(buf+t,sizeof(buf)-t," %s",arg[k]); |
52 | } |
52 | } |
53 | t=strlen(buf); |
53 | t=strlen(buf); |
54 | snprintf(buf+t,sizeof(buf)-t,"\n %s\n",strerror(errno)); |
54 | snprintf(buf+t,sizeof(buf)-t,"\n %s\n",strerror(errno)); |
55 |
|
55 | wlogdaccessfile(buf,"a","%s/exec.fail",tmpd); |
56 | exit(127); |
56 | exit(127); |
57 | } |
57 | } |
58 | else { /* parent */ |
58 | else { /* parent */ |
59 | status=0; |
59 | status=0; |
60 | if(exec_wait) { |
60 | if(exec_wait) { |
Line 121... | Line 121... | ||
121 | exec_wait=wait; |
121 | exec_wait=wait; |
122 | return execredirected(cmdf,inf,outf,errf,arg); |
122 | return execredirected(cmdf,inf,outf,errf,arg); |
123 | } |
123 | } |
124 | 124 | ||
125 | /* Read/write to a file with variable parms to print filename */ |
125 | /* Read/write to a file with variable parms to print filename */ |
126 | void |
126 | void wlogdaccessfile(char *content, char *type, char *s,...) |
127 | { |
127 | { |
128 | va_list vp; |
128 | va_list vp; |
129 | char buf[MAX_LINELEN+1]; |
129 | char buf[MAX_LINELEN+1]; |
130 | FILE *f; |
130 | FILE *f; |
131 | int l; |
131 | int l; |
Line 188... | Line 188... | ||
188 | va_start(vp,p); |
188 | va_start(vp,p); |
189 | vsnprintf(pp,sizeof(lbuf)-(pp-lbuf),p,vp); |
189 | vsnprintf(pp,sizeof(lbuf)-(pp-lbuf),p,vp); |
190 | va_end(vp); |
190 | va_end(vp); |
191 | pp=strchr(lbuf,'\n'); if(pp) *pp=0; |
191 | pp=strchr(lbuf,'\n'); if(pp) *pp=0; |
192 | strip_trailing_spaces(lbuf); strcat(lbuf,"\n"); |
192 | strip_trailing_spaces(lbuf); strcat(lbuf,"\n"); |
193 |
|
193 | wlogdaccessfile(lbuf,"a",debugfile); |
194 | } |
194 | } |
195 | 195 |