1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-11 22:23:24 +00:00

Fixed build issues on disabled features

This commit is contained in:
Gerhard Rieger 2025-01-29 21:49:16 +01:00
parent af7d44d751
commit 7a90caade5
21 changed files with 182 additions and 95 deletions

View file

@ -471,14 +471,14 @@ static xiofile_t *xioallocfd(void) {
fd->stream.escape = -1;
/* fd->stream.para.exec.pid = 0; */
fd->stream.lineterm = LINETERM_RAW;
#if WITH_RESOLVE
#if ( _WITH_IP4 || _WITH_IP6 ) && WITH_RESOLVE
#if HAVE_RES_RETRANS
fd->stream.para.socket.ip.res.retrans = -1;
#endif
#if HAVE_RES_RETRY
fd->stream.para.socket.ip.res.retry = -1;
#endif
#endif /* WITH_RESOLVE */
#endif /* ( _WITH_IP4 || _WITH_IP6 ) && WITH_RESOLVE */
return fd;
}
@ -701,10 +701,10 @@ int xioopen_single(xiofile_t *xfd, int xioflags) {
mode_t orig_umask, tmp_umask;
int result;
/* Values to be saved until xioopen() is finished */
#if WITH_RESOLVE && HAVE_RESOLV_H
#if ( _WITH_IP4 || _WITH_IP6 ) && WITH_RESOLVE && HAVE_RESOLV_H
int do_res;
struct __res_state save_res;
#endif /* WITH_RESOLVE && HAVE_RESOLV_H */
#endif
#if WITH_NAMESPACES
int save_netfd = -1;
#endif
@ -735,10 +735,10 @@ int xioopen_single(xiofile_t *xfd, int xioflags) {
return -1;
#endif /* WITH_NAMESPACES */
#if WITH_RESOLVE && HAVE_RESOLV_H
#if ( _WITH_IP4 || _WITH_IP6 ) && WITH_RESOLVE && HAVE_RESOLV_H
if ((do_res = xio_res_init(sfd, &save_res)) < 0)
return STAT_NORETRY;
#endif /* WITH_RESOLVE && HAVE_RESOLV_H */
#endif
if (xio_chdir(sfd->opts, &orig_dir) < 0)
return STAT_NORETRY;
@ -769,10 +769,10 @@ int xioopen_single(xiofile_t *xfd, int xioflags) {
free(orig_dir);
}
#if WITH_RESOLVE && HAVE_RESOLV_H
#if ( _WITH_IP4 || _WITH_IP6 ) && WITH_RESOLVE && HAVE_RESOLV_H
if (do_res)
xio_res_restore(&save_res);
#endif /* WITH_RESOLVE && HAVE_RESOLV_H */
#endif
#if WITH_NAMESPACES
if (save_netfd > 0) {