Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Bring back some portability scheme
Baptiste Daroussin committed 6 years ago
commit d22e5a856ac9231dbe3edfc92230d430036143da
parent 12de6d9
1 file changed +7 -5
modified external/libfetch/ftp.c
@@ -135,7 +135,9 @@ unmappedaddr(struct sockaddr_in6 *sin6)
	sin4->sin_addr.s_addr = addr;
	sin4->sin_port = port;
	sin4->sin_family = AF_INET;
+
#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LE
	sin4->sin_len = sizeof(struct sockaddr_in);
+
#endif
}

/*
@@ -487,7 +489,7 @@ struct ftpio {

static int	 ftp_readfn(void *, char *, int);
static int	 ftp_writefn(void *, const char *, int);
-
static fpos_t	 ftp_seekfn(void *, fpos_t, int);
+
static off_t	 ftp_seekfn(void *, off_t, int);
static int	 ftp_closefn(void *);

static int
@@ -550,18 +552,18 @@ ftp_writefn(void *v, const char *buf, int len)
	return (-1);
}

-
static fpos_t
-
ftp_seekfn(void *v, fpos_t pos __unused, int whence __unused)
+
static off_t
+
ftp_seekfn(void *v, off_t pos __unused, int whence __unused)
{
	struct ftpio *io;

	io = (struct ftpio *)v;
	if (io == NULL) {
		errno = EBADF;
-
		return (-1);
+
		return ((off_t)-1);
	}
	errno = ESPIPE;
-
	return (-1);
+
	return ((off_t)-1);
}

static int