[Ecls-list] Errors in unixsys.d

dan at sof.ch dan at sof.ch
Mon Nov 1 08:00:14 UTC 2004


Hi there,

While musing, I found some error in the sys:run-program function.

The child_pid variable was shadowed by the local declaration and the
first execvp argument was a cl_object. 

With this 2 bugs, run-program will always fail :(((

Here follows the fix against last cvs checkout

Have fun.
-- 
Courage, fuyons...


diff -r1.22 unixsys.d
249d248
<       int child_pid;
280,281c279
<       child_pid = fork();
<       if (child_pid == 0) {
---
>       if ((child_pid = fork()) == 0) {
295,302c293
<                       if (arg == Cnil) {
<                               argv_ptr[j] = NULL;
<                       } else {
<                               argv_ptr[j] = arg->string.self;
<                       }
<               }
<               if (execvp(command, argv_ptr) < 0) {
<                       abort();
---
>                       argv_ptr[j] = (arg == Cnil) ? NULL : arg->string.self;
303a295,298
>               execvp(command->string.self, argv_ptr);
>               /* at this point exec has failed */
>               perror("exec");
>               abort();




More information about the ecl-devel mailing list