Pelles C > Bug reports

Problem with spawn a process

<< < (2/2)

TimoVJL:
This one doesn't crash:

--- Code: ---int TestSpawn1(const char *ufile)
{
long long notepad_id=0;
int rc=0;
const char *sargv[] = {"notepad.exe",ufile,0};

notepad_id=_cwait (&rc, _spawnv(_P_NOWAIT, "C:\\Windows\\notepad.exe", (char* const*)sargv), 0);
if (log) fprintf(log, "\n    STATUS %d, NPAD_ID %lld\n", rc, notepad_id);

return rc;
}
--- End code ---
_spawnl calls _spawnve and that crash too.

Jens:
Thanks frankie and Timo,

@Timo
i import your TestSpawn1 function in my example, but no success.
Crashes at the first call to fclose() function.

I think frankie is on the right way

My workaround is to close all open files before calling spawn function
and open then after returning in append mode

nice and sunny  8) weekend
greetings from Kiel
Jens  ;)

Navigation

[0] Message Index

[*] Previous page

Go to full version