[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] How program CWD can change during appl_init() call?
Hi,
On keskiviikko 09 tammikuu 2013, Helmut Karlowski wrote:
> Eero Tamminen, 09.01.2013 14:38:14:
> > Test-case source and binaries are attached. Problem happens with VBCC
> > built testvc.prg, it doesn't happen with GCC/MiNTlib built testgcc.prg.
>
> With testvc.prg I get:
>
> BALLER.RSC fopen() OK
> then
> ERROR: BALLER.RSC cannot be loaded!
>
> Is this what you mean?
Yes.
Both fopen() and rsrc_load() are given the same filename,
"BALLER.RSC" as you can see from the sources I sent.
fopen() (= thin wrapper for Fopen()) succeeds, rsrc_load() fails.
> With testgcc.prg I get
>
> BALLER.RSC loading OK!
>
> But hitting Return does not close the alert which works with testvc ...
I've wondered about that too, why it needs multiple Return presses.
As you can see from the sources, it's just a normal form_alert() call.
GCC, binutils, GEMlib and MiNTlib used to build testgcc.prg are
the latest ones from Sparemint:
http://sparemint.org/sparemint/html/packages/gcc.html
http://sparemint.org/sparemint/html/packages/binutils.html
http://sparemint.org/sparemint/html/packages/gemlib.html
http://sparemint.org/sparemint/html/packages/mintlib-devel.html
Does the same problem happen if you build test.c with newer
GCC/GEMlib/MiNTlib?
> The debug-output tells me:
>
> pid 35 (testvc): Dsetpath(\d\wnload/t\st.gem/.\)
> pid 35 (testvc): Dsetpath(\d\wnload/t\st.gem/.\): returning -33
>
> and later:
>
> pid 35 (testvc): Dgetcwd(@, 255)
> pid 35 (testvc): Fstat64(BALLER.RSC): path2cookie returned -33
>
> Looks strange, but the failed Dsetpath should not change the path, so it
> should find the RSC. Will have a look, thanks.
AFAIK VBCC (libraries) don't have any calls to Dsetpath()
and the test program definitely doesn't have them, so
these calls are being done on the OS side.
> This is from testgcc:
>
> pid 37 (testgcc): do_open(BALLER.RSC): mode 0x81A4
...
> pid 37 (testgcc): do_open(U:/f/download/test.gem/./\baller.rsc) -> 0
>
> So there are surely differences from the libraries or whatever.
Yes. :-)
- Eero