mirror of
https://github.com/curl/curl.git
synced 2026-08-08 08:33:01 +03:00
weirdo hack to fix debian bug report 278691:
'curl -v writes debugging to its network socket if stderr is closed'
This commit is contained in:
parent
3347ced899
commit
facfa19cdd
4 changed files with 39 additions and 0 deletions
|
|
@ -109,3 +109,9 @@
|
|||
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#undef HAVE_GETTIMEOFDAY
|
||||
|
||||
/* Define to 1 if you have the `ftruncate' function. */
|
||||
#undef HAVE_FTRUNCATE
|
||||
|
||||
/* Define to 1 if you have the `pipe' function. */
|
||||
#undef HAVE_PIPE
|
||||
|
|
|
|||
23
src/main.c
23
src/main.c
|
|
@ -3771,12 +3771,35 @@ operate(struct Configurable *config, int argc, char *argv[])
|
|||
return res;
|
||||
}
|
||||
|
||||
static void checkfds(void);
|
||||
|
||||
static void checkfds(void)
|
||||
{
|
||||
#ifdef HAVE_PIPE
|
||||
int fd[2] = { STDIN_FILENO, STDIN_FILENO };
|
||||
while( fd[0] == STDIN_FILENO ||
|
||||
fd[0] == STDOUT_FILENO ||
|
||||
fd[0] == STDERR_FILENO ||
|
||||
fd[1] == STDIN_FILENO ||
|
||||
fd[1] == STDOUT_FILENO ||
|
||||
fd[1] == STDERR_FILENO )
|
||||
pipe(fd);
|
||||
|
||||
close(fd[0]);
|
||||
close(fd[1]);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int res;
|
||||
struct Configurable config;
|
||||
memset(&config, 0, sizeof(struct Configurable));
|
||||
|
||||
checkfds();
|
||||
|
||||
res = operate(&config, argc, argv);
|
||||
free_config_fields(&config);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue