Skip to content

Commit c35e5fd

Browse files
committed
Fix Compile Error with gcc 11.3.0(in Ubuntu 22.04). Close #736.
1 parent 761dee8 commit c35e5fd

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

app/nginx-1.16.1/src/event/modules/ngx_ff_module.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,11 @@ kevent(int kq, const struct kevent *changelist, int nchanges,
545545
return ff_kevent(kq, changelist, nchanges, eventlist, nevents, timeout);
546546
}
547547

548+
/*
549+
* It is need to modify the definition, such as Ubuntu 22.04 or later.
550+
*
551+
* int(struct timeval * restrict, void * restrict)
552+
*/
548553
int
549554
gettimeofday(struct timeval *tv, struct timezone *tz)
550555
{

freebsd/kern/kern_linker.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ linker_file_add_dependency(linker_file_t file, linker_file_t dep)
771771
file->deps[file->ndeps] = dep;
772772
file->ndeps++;
773773
KLD_DPF(FILE, ("linker_file_add_dependency:"
774-
" adding %s as dependency for %s\n",
774+
" adding %s as dependency for %s\n",
775775
dep->filename, file->filename));
776776
return (0);
777777
}
@@ -1862,7 +1862,11 @@ linker_hints_lookup(const char *path, int pathlen, const char *modname,
18621862
goto bad;
18631863
best = cp = NULL;
18641864
error = VOP_GETATTR(nd.ni_vp, &vattr, cred);
1865+
#ifdef FSTACK
1866+
if (error || vattr.va_size == 0)
1867+
#else
18651868
if (error)
1869+
#endif
18661870
goto bad;
18671871
/*
18681872
* XXX: we need to limit this number to some reasonable value

freebsd/netinet/in_mcast.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,11 @@ imf_get_source(struct in_mfilter *imf, const struct sockaddr_in *psin,
760760
if (lims == NULL) {
761761
if (imf->imf_nsrc == in_mcast_maxsocksrc)
762762
return (ENOSPC);
763+
#ifdef FSTACK
764+
nims = malloc(sizeof(struct ip_msource), M_INMFILTER,
765+
#else
763766
nims = malloc(sizeof(struct in_msource), M_INMFILTER,
767+
#endif
764768
M_NOWAIT | M_ZERO);
765769
if (nims == NULL)
766770
return (ENOMEM);
@@ -791,7 +795,11 @@ imf_graft(struct in_mfilter *imf, const uint8_t st1,
791795
struct ip_msource *nims;
792796
struct in_msource *lims;
793797

798+
#ifdef FSTACK
799+
nims = malloc(sizeof(struct ip_msource), M_INMFILTER,
800+
#else
794801
nims = malloc(sizeof(struct in_msource), M_INMFILTER,
802+
#endif
795803
M_NOWAIT | M_ZERO);
796804
if (nims == NULL)
797805
return (NULL);

freebsd/netinet6/in6_mcast.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,11 @@ im6f_get_source(struct in6_mfilter *imf, const struct sockaddr_in6 *psin,
729729
if (lims == NULL) {
730730
if (imf->im6f_nsrc == in6_mcast_maxsocksrc)
731731
return (ENOSPC);
732+
#ifdef FSTACK
733+
nims = malloc(sizeof(struct ip6_msource), M_IN6MFILTER,
734+
#else
732735
nims = malloc(sizeof(struct in6_msource), M_IN6MFILTER,
736+
#endif
733737
M_NOWAIT | M_ZERO);
734738
if (nims == NULL)
735739
return (ENOMEM);
@@ -760,7 +764,11 @@ im6f_graft(struct in6_mfilter *imf, const uint8_t st1,
760764
struct ip6_msource *nims;
761765
struct in6_msource *lims;
762766

767+
#ifdef FSTACK
768+
nims = malloc(sizeof(struct ip6_msource), M_IN6MFILTER,
769+
#else
763770
nims = malloc(sizeof(struct in6_msource), M_IN6MFILTER,
771+
#endif
764772
M_NOWAIT | M_ZERO);
765773
if (nims == NULL)
766774
return (NULL);

0 commit comments

Comments
 (0)