Skip to content

Commit

Permalink
Fix Compile Error with gcc 11.3.0(in Ubuntu 22.04). Close #736.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfb8856606 committed Feb 16, 2023
1 parent 761dee8 commit c35e5fd
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/nginx-1.16.1/src/event/modules/ngx_ff_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,11 @@ kevent(int kq, const struct kevent *changelist, int nchanges,
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
gettimeofday(struct timeval *tv, struct timezone *tz)
{
Expand Down
6 changes: 5 additions & 1 deletion freebsd/kern/kern_linker.c
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ linker_file_add_dependency(linker_file_t file, linker_file_t dep)
file->deps[file->ndeps] = dep;
file->ndeps++;
KLD_DPF(FILE, ("linker_file_add_dependency:"
" adding %s as dependency for %s\n",
" adding %s as dependency for %s\n",
dep->filename, file->filename));
return (0);
}
Expand Down Expand Up @@ -1862,7 +1862,11 @@ linker_hints_lookup(const char *path, int pathlen, const char *modname,
goto bad;
best = cp = NULL;
error = VOP_GETATTR(nd.ni_vp, &vattr, cred);
#ifdef FSTACK
if (error || vattr.va_size == 0)
#else
if (error)
#endif
goto bad;
/*
* XXX: we need to limit this number to some reasonable value
Expand Down
8 changes: 8 additions & 0 deletions freebsd/netinet/in_mcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,11 @@ imf_get_source(struct in_mfilter *imf, const struct sockaddr_in *psin,
if (lims == NULL) {
if (imf->imf_nsrc == in_mcast_maxsocksrc)
return (ENOSPC);
#ifdef FSTACK
nims = malloc(sizeof(struct ip_msource), M_INMFILTER,
#else
nims = malloc(sizeof(struct in_msource), M_INMFILTER,
#endif
M_NOWAIT | M_ZERO);
if (nims == NULL)
return (ENOMEM);
Expand Down Expand Up @@ -791,7 +795,11 @@ imf_graft(struct in_mfilter *imf, const uint8_t st1,
struct ip_msource *nims;
struct in_msource *lims;

#ifdef FSTACK
nims = malloc(sizeof(struct ip_msource), M_INMFILTER,
#else
nims = malloc(sizeof(struct in_msource), M_INMFILTER,
#endif
M_NOWAIT | M_ZERO);
if (nims == NULL)
return (NULL);
Expand Down
8 changes: 8 additions & 0 deletions freebsd/netinet6/in6_mcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,11 @@ im6f_get_source(struct in6_mfilter *imf, const struct sockaddr_in6 *psin,
if (lims == NULL) {
if (imf->im6f_nsrc == in6_mcast_maxsocksrc)
return (ENOSPC);
#ifdef FSTACK
nims = malloc(sizeof(struct ip6_msource), M_IN6MFILTER,
#else
nims = malloc(sizeof(struct in6_msource), M_IN6MFILTER,
#endif
M_NOWAIT | M_ZERO);
if (nims == NULL)
return (ENOMEM);
Expand Down Expand Up @@ -760,7 +764,11 @@ im6f_graft(struct in6_mfilter *imf, const uint8_t st1,
struct ip6_msource *nims;
struct in6_msource *lims;

#ifdef FSTACK
nims = malloc(sizeof(struct ip6_msource), M_IN6MFILTER,
#else
nims = malloc(sizeof(struct in6_msource), M_IN6MFILTER,
#endif
M_NOWAIT | M_ZERO);
if (nims == NULL)
return (NULL);
Expand Down

0 comments on commit c35e5fd

Please sign in to comment.