mirror of
https://github.com/curl/curl.git
synced 2026-07-28 19:23:06 +03:00
build: avoid overriding system open and stat symbols
Replace them by `curlx_open()` and `curlx_stat()`. To make it obvious in the source code what is being executed. Also: - tests/server: stop overriding `open()` for test servers. This is critical for the call made from the signal handler. For other calls, it's an option to use `curlx_open()`, but doesn't look important enough to do it, following the path taken with `fopen()`. Follow-up to10bac43b87#18774 Follow-up to20142f5d06#18634 Follow-up tobf7375ecc5#18503 Closes #18776
This commit is contained in:
parent
684f4cdd3e
commit
9678ff5b1b
31 changed files with 76 additions and 83 deletions
|
|
@ -3,4 +3,5 @@ allowfunc fdopen
|
|||
allowfunc fopen
|
||||
allowfunc gmtime
|
||||
allowfunc localtime
|
||||
allowfunc open
|
||||
allowfunc socket
|
||||
|
|
|
|||
|
|
@ -104,6 +104,7 @@ int main(int argc, char **argv)
|
|||
return 2;
|
||||
|
||||
#ifdef UNDER_CE
|
||||
/* !checksrc! disable BANNEDFUNC 1 */
|
||||
stat(file, &file_info);
|
||||
#else
|
||||
fstat(fileno(fp), &file_info);
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ int main(void)
|
|||
|
||||
/* to get the file size */
|
||||
#ifdef UNDER_CE
|
||||
/* !checksrc! disable BANNEDFUNC 1 */
|
||||
if(stat("debugit", &file_info) != 0) {
|
||||
#else
|
||||
if(fstat(fileno(fd), &file_info) != 0) {
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ int main(void)
|
|||
|
||||
/* to get the file size */
|
||||
#ifdef UNDER_CE
|
||||
/* !checksrc! disable BANNEDFUNC 1 */
|
||||
if(stat(LOCAL_FILE, &file_info) != 0) {
|
||||
#else
|
||||
if(fstat(fileno(hd_src), &file_info) != 0) {
|
||||
|
|
|
|||
|
|
@ -234,6 +234,7 @@ static int setup(struct input *i, int num, const char *upload)
|
|||
}
|
||||
|
||||
#ifdef UNDER_CE
|
||||
/* !checksrc! disable BANNEDFUNC 1 */
|
||||
if(stat(upload, &file_info) != 0) {
|
||||
#else
|
||||
if(fstat(fileno(i->in), &file_info) != 0) {
|
||||
|
|
|
|||
|
|
@ -91,6 +91,7 @@ int main(int argc, char **argv)
|
|||
|
||||
/* get the file size of the local file */
|
||||
#ifdef UNDER_CE
|
||||
/* !checksrc! disable BANNEDFUNC 1 */
|
||||
if(stat(file, &file_info) != 0) {
|
||||
#else
|
||||
if(fstat(fileno(hd_src), &file_info) != 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue