mirror of
https://github.com/curl/curl.git
synced 2026-08-25 06:03:32 +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,6 +3,7 @@ allowfunc fclose
|
|||
allowfunc fopen
|
||||
allowfunc freeaddrinfo
|
||||
allowfunc getaddrinfo
|
||||
allowfunc open
|
||||
allowfunc recv
|
||||
allowfunc send
|
||||
allowfunc socket
|
||||
|
|
|
|||
|
|
@ -373,12 +373,12 @@ static void exit_signal_handler(int signum)
|
|||
(void)!write(STDERR_FILENO, msg, sizeof(msg) - 1);
|
||||
}
|
||||
else {
|
||||
int fd;
|
||||
#ifdef _WIN32
|
||||
fd = _open(serverlogfile, O_WRONLY|O_CREAT|O_APPEND, S_IREAD | S_IWRITE);
|
||||
#define OPENMODE S_IREAD | S_IWRITE
|
||||
#else
|
||||
fd = open(serverlogfile, O_WRONLY|O_CREAT|O_APPEND, S_IRUSR | S_IWUSR);
|
||||
#define OPENMODE S_IRUSR | S_IWUSR
|
||||
#endif
|
||||
int fd = open(serverlogfile, O_WRONLY | O_CREAT | O_APPEND, OPENMODE);
|
||||
if(fd != -1) {
|
||||
static const char msg[] = "exit_signal_handler: called\n";
|
||||
(void)!write(fd, msg, sizeof(msg) - 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue