mirror of
https://github.com/curl/curl.git
synced 2026-08-24 18:33:34 +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
|
|
@ -30,10 +30,6 @@
|
|||
#ifndef HAVE_GETPASS_R
|
||||
/* this file is only for systems without getpass_r() */
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
# include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TERMIOS_H
|
||||
# include <termios.h>
|
||||
#elif defined(HAVE_TERMIO_H)
|
||||
|
|
@ -178,7 +174,7 @@ char *getpass_r(const char *prompt, /* prompt to display */
|
|||
{
|
||||
ssize_t nread;
|
||||
bool disabled;
|
||||
int fd = open("/dev/tty", O_RDONLY);
|
||||
int fd = curlx_open("/dev/tty", O_RDONLY);
|
||||
if(fd == -1)
|
||||
fd = STDIN_FILENO; /* use stdin if the tty could not be used */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue