mirror of
https://github.com/frida/tinycc
synced 2024-11-25 00:59:37 +03:00
fix a bug #43984: tcc -run reports errno=2
The following program (errno.c) reports errno=2 when run using "tcc -run errno.c" #include <errno.h> #include <stdio.h> int main(void) { printf("errno=%d\n", errno); return 0; }
This commit is contained in:
parent
724425addf
commit
cde79a805e
4
tccrun.c
4
tccrun.c
@ -127,6 +127,7 @@ LIBTCCAPI int tcc_run(TCCState *s1, int argc, char **argv)
|
||||
for (i=0; i<argc; ++i)
|
||||
bound_new_region(argv[i], strlen(argv[i]));
|
||||
|
||||
errno = 0; /* clean errno value */
|
||||
ret = (*prog_main)(argc, argv);
|
||||
|
||||
/* unmark argv area */
|
||||
@ -137,7 +138,10 @@ LIBTCCAPI int tcc_run(TCCState *s1, int argc, char **argv)
|
||||
bound_exit();
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
errno = 0; /* clean errno value */
|
||||
ret = (*prog_main)(argc, argv);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user