|
1. Use one descriptor opened read/write and use it for stdin/stdout/stderr rather than opening twice.
as in the single "open(con,O_RDWR)"
2, try using write and read to confirm input/output before using the stdio APIs.
3. Also, check that you actually need the dup2s, as you have already done close(0/1/2)
try
fd=open(con,O_RDWR);
dup2(1,fd);
dup2(2,fd);
|