Revision 1.1 |
Revision 1.2 |
Line 9 |
Line 9 |
return (void)NULL; }  
|
return (void)NULL; }  
|
int do_job(msg* req)
|
int do_job(msg * req)
|
{
|
{
|
FILE* tf = tmpfile();
int child_pid;
int pipes[2];
|
FILE *tf = tmpfile();
int child_pid;
int pipes[2];
|
|
|
if (NULL==tmpfile) return -1;
|
if (NULL == tmpfile)
|
|
return -1;
|
|
|
pipe(pipes);
|
pipe(pipes);
|
|
|
if ( -1 == dup2(pipes[1], STDOUT_FILENO) )
{
perror("dup2 - pipes");
close(pipes[0]);
close(pipes[1]);
exit(1);
|
if (-1 == dup2(pipes[1], STDOUT_FILENO)) {
perror("dup2 - pipes");
close(pipes[0]);
close(pipes[1]);
exit(1);
}
|
}
|
|
/* if ( -1 == fcntl(pipes[1], F_SETFL, 0) ) {
|
/* if ( -1 == fcntl(pipes[1], F_SETFL, 0) ) {
|
Line 44 |
Line 44 |
} */
|
} */
|
if (req->is_cgi)
|
if (req->is_cgi) {
|
{
|
|
// execve // implement later.... hahaha
|
// execve // implement later.... hahaha
|
}
|
}
|
|
|
return 0;
|
return 0;
|
}
|
}
|
int
|
int tmp_cgi(msg * req)
|
tmp_cgi(msg* req)
|
|
{
|
{
|
return 0;
// fork off here later
// for now, just call
do_job( req );
return 0;
|
return 0;
// fork off here later
// for now, just call
do_job(req);
return 0;
|
}
|
}
|