Xref: utzoo comp.lang.c:38851 comp.unix.sysv386:7541 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!caen!ox.com!math.fu-berlin.de!fub!dobag.in-berlin.de!nicedel!nyse From: nyse@nicedel.north.de (Hermann Behrens) Newsgroups: comp.lang.c,comp.unix.sysv386 Subject: How to execute 'sz' and 'rc' ? Message-ID: <1991Apr29.221812.5038@nicedel.north.de> Date: 29 Apr 91 22:18:12 GMT Organization: NICE DELmenhorst, FRG Lines: 53 Hello. I have problems to execute an external protocoll, in this case zmodem. I open the device, let the programm call a mailbox(up to this point no problems), but when i have to execute the sz, i get errors :-( this is my routine to start sz: int zm_upload() { int pid, status; chdir("/somewhere"); if((pid = fork()) == 0) { close(fp); close(0); open("/dev/ttyF00", O_RDONLY | O_NDELAY); close(1); open("/dev/ttyF00", O_WRONLY | O_NDELAY); /* I think, that the bug is in the redirecting of stdin and stdout, but where is the bug?? */ execl("/bin/sh", "sh", "-c", "sz a_file",NULL); } else wait(&status); } int zm_download() { int pid, status; chdir("/somewhere"); if((pid = fork()) == 0) { close(fp); close(0); open("/dev/ttyF00", O_RDONLY | O_NDELAY); close(1); open("/dev/ttyF00", O_RDONLY | O_NDELAY); execl("/bin/sh", "sh", "-c", "rz", NULL); } else wait(&status); } It would be great, if someone could help me ... ciao, Hermann Behrens -- Hermann Behrens|Bremerstr. 323|2870 Delmenhorst|04221/71931(DATA)71932(VOICE)