History

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; }

seyko committed 11 years ago

Commit cde79a81 parent 724425a1 file · +4 −0Browse files

Unified · Split

tccrun.c+4−0
@@ -127,6 +127,7 @@ LIBTCCAPI int tcc_run(TCCState *s1, int argc, char **argv) · 126 unmodified lines
127 for (i=0; i<argc; ++i)127 for (i=0; i<argc; ++i)
128 bound_new_region(argv[i], strlen(argv[i]));128 bound_new_region(argv[i], strlen(argv[i]));
129 129
130 errno = 0; /* clean errno value */
130 ret = (*prog_main)(argc, argv);131 ret = (*prog_main)(argc, argv);
131 132
132 /* unmark argv area */133 /* unmark argv area */
@@ -137,7 +138,10 @@ LIBTCCAPI int tcc_run(TCCState *s1, int argc, char **argv) · 4 unmodified lines
137 bound_exit();138 bound_exit();
138 } else139 } else
139#endif140#endif
141 {
142 errno = 0; /* clean errno value */
140 ret = (*prog_main)(argc, argv);143 ret = (*prog_main)(argc, argv);
144 }
141 return ret;145 return ret;
142}146}
143 147

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t