[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: works under Red Hat, not Debian



> 
> 
> I have made myself an executable octave script called octave_test.mex and
> made it executable with chmodand the #!/interpreterpath mechanism.  On
> both Red Hat and Debian, typing ./octave_test.mex runs the script as
> expected.  I made also a c code wrapper for this program, so as to obey
> the letter of the law in one of my classes if not the spirit.  The wrapper
> looks like this: 
> 
> #include <unistd.h>
> 
> main()
> {
>   execl("/home/Gandalf/octave_test.mex",
>                     (void *) 0);
> }
> 
> 
> It is called octave_wrapper.c and compiles via
> 
>   gcc -o octest octave_wrapper.c
> 
> to octest.  On the red hat systems we have at school, the executable works
> fine and the executable octave script runs as expected.  I know the octave
> binary is in a different place on Debian, but that error was reported when
> I made it at school.  On my Debian system at home, nothing happens and the
> prompt instantly reappears.  It is the same performance I get if the path
> in the execl function is wrong, but I have checked and re-checked that,
> moved it around, opened all permissions, and generally tried everyting I
> can think of to make it go.  The code was ftp'd straight accross, and
> anyway as you can see there isn't much code to miss errors in.  If anyone
> has any idea why Debian would be doing this, I would appreciate it. 

Did you check if the execl() function returned (i.e., was not
successful)?  What is the result of the following (untested!) code?

------------------------------------------------------------------------
#include <unistd.h>
#include <stdio.h>

int main(void) {
  if(execl("/home/Gandalf/octave_test.mex", (void *) 0) == -1) {
    perror("execl failed");
  }

  return 0;
}
------------------------------------------------------------------------

Eric Meijer


-- 
 E.L. Meijer (tgakem@chem.tue.nl)          | tel. office +31 40 2472189
 Eindhoven Univ. of Technology             | tel. lab.   +31 40 2475032
 Lab. for Catalysis and Inorg. Chem. (TAK) | tel. fax    +31 40 2455054


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: