mirror of https://github.com/F-Stack/f-stack.git
Fix Compile Error with gcc 11.3.0(in Ubuntu 22.04). Close #736.
This commit is contained in:
parent
761dee801d
commit
c35e5fda17
app/nginx-1.16.1/src/event/modules
freebsd
|
@ -545,6 +545,11 @@ kevent(int kq, const struct kevent *changelist, int nchanges,
|
||||||
return ff_kevent(kq, changelist, nchanges, eventlist, nevents, timeout);
|
return ff_kevent(kq, changelist, nchanges, eventlist, nevents, timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* It is need to modify the definition, such as Ubuntu 22.04 or later.
|
||||||
|
*
|
||||||
|
* int(struct timeval * restrict, void * restrict)
|
||||||
|
*/
|
||||||
int
|
int
|
||||||
gettimeofday(struct timeval *tv, struct timezone *tz)
|
gettimeofday(struct timeval *tv, struct timezone *tz)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1862,7 +1862,11 @@ linker_hints_lookup(const char *path, int pathlen, const char *modname,
|
||||||
goto bad;
|
goto bad;
|
||||||
best = cp = NULL;
|
best = cp = NULL;
|
||||||
error = VOP_GETATTR(nd.ni_vp, &vattr, cred);
|
error = VOP_GETATTR(nd.ni_vp, &vattr, cred);
|
||||||
|
#ifdef FSTACK
|
||||||
|
if (error || vattr.va_size == 0)
|
||||||
|
#else
|
||||||
if (error)
|
if (error)
|
||||||
|
#endif
|
||||||
goto bad;
|
goto bad;
|
||||||
/*
|
/*
|
||||||
* XXX: we need to limit this number to some reasonable value
|
* XXX: we need to limit this number to some reasonable value
|
||||||
|
|
|
@ -760,7 +760,11 @@ imf_get_source(struct in_mfilter *imf, const struct sockaddr_in *psin,
|
||||||
if (lims == NULL) {
|
if (lims == NULL) {
|
||||||
if (imf->imf_nsrc == in_mcast_maxsocksrc)
|
if (imf->imf_nsrc == in_mcast_maxsocksrc)
|
||||||
return (ENOSPC);
|
return (ENOSPC);
|
||||||
|
#ifdef FSTACK
|
||||||
|
nims = malloc(sizeof(struct ip_msource), M_INMFILTER,
|
||||||
|
#else
|
||||||
nims = malloc(sizeof(struct in_msource), M_INMFILTER,
|
nims = malloc(sizeof(struct in_msource), M_INMFILTER,
|
||||||
|
#endif
|
||||||
M_NOWAIT | M_ZERO);
|
M_NOWAIT | M_ZERO);
|
||||||
if (nims == NULL)
|
if (nims == NULL)
|
||||||
return (ENOMEM);
|
return (ENOMEM);
|
||||||
|
@ -791,7 +795,11 @@ imf_graft(struct in_mfilter *imf, const uint8_t st1,
|
||||||
struct ip_msource *nims;
|
struct ip_msource *nims;
|
||||||
struct in_msource *lims;
|
struct in_msource *lims;
|
||||||
|
|
||||||
|
#ifdef FSTACK
|
||||||
|
nims = malloc(sizeof(struct ip_msource), M_INMFILTER,
|
||||||
|
#else
|
||||||
nims = malloc(sizeof(struct in_msource), M_INMFILTER,
|
nims = malloc(sizeof(struct in_msource), M_INMFILTER,
|
||||||
|
#endif
|
||||||
M_NOWAIT | M_ZERO);
|
M_NOWAIT | M_ZERO);
|
||||||
if (nims == NULL)
|
if (nims == NULL)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
|
@ -729,7 +729,11 @@ im6f_get_source(struct in6_mfilter *imf, const struct sockaddr_in6 *psin,
|
||||||
if (lims == NULL) {
|
if (lims == NULL) {
|
||||||
if (imf->im6f_nsrc == in6_mcast_maxsocksrc)
|
if (imf->im6f_nsrc == in6_mcast_maxsocksrc)
|
||||||
return (ENOSPC);
|
return (ENOSPC);
|
||||||
|
#ifdef FSTACK
|
||||||
|
nims = malloc(sizeof(struct ip6_msource), M_IN6MFILTER,
|
||||||
|
#else
|
||||||
nims = malloc(sizeof(struct in6_msource), M_IN6MFILTER,
|
nims = malloc(sizeof(struct in6_msource), M_IN6MFILTER,
|
||||||
|
#endif
|
||||||
M_NOWAIT | M_ZERO);
|
M_NOWAIT | M_ZERO);
|
||||||
if (nims == NULL)
|
if (nims == NULL)
|
||||||
return (ENOMEM);
|
return (ENOMEM);
|
||||||
|
@ -760,7 +764,11 @@ im6f_graft(struct in6_mfilter *imf, const uint8_t st1,
|
||||||
struct ip6_msource *nims;
|
struct ip6_msource *nims;
|
||||||
struct in6_msource *lims;
|
struct in6_msource *lims;
|
||||||
|
|
||||||
|
#ifdef FSTACK
|
||||||
|
nims = malloc(sizeof(struct ip6_msource), M_IN6MFILTER,
|
||||||
|
#else
|
||||||
nims = malloc(sizeof(struct in6_msource), M_IN6MFILTER,
|
nims = malloc(sizeof(struct in6_msource), M_IN6MFILTER,
|
||||||
|
#endif
|
||||||
M_NOWAIT | M_ZERO);
|
M_NOWAIT | M_ZERO);
|
||||||
if (nims == NULL)
|
if (nims == NULL)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
Loading…
Reference in New Issue