Change incorrect NULLs to 0s
This commit is contained in:
parent
faf052a79e
commit
369dc8ceb8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=54952
@ -68,7 +68,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym)
|
||||
if (sym == NULL)
|
||||
return -1;
|
||||
addr = (Elf_Addr)linker_file_lookup_symbol(lf, sym, 1);
|
||||
if (addr == NULL)
|
||||
if (addr == 0)
|
||||
return -1;
|
||||
addr += addend;
|
||||
if (*where != addr)
|
||||
@ -79,7 +79,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym)
|
||||
if (sym == NULL)
|
||||
return -1;
|
||||
addr = (Elf_Addr)linker_file_lookup_symbol(lf, sym, 1);
|
||||
if (addr == NULL)
|
||||
if (addr == 0)
|
||||
return -1;
|
||||
addr += addend - (Elf_Addr)where;
|
||||
if (*where != addr)
|
||||
@ -99,7 +99,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym)
|
||||
if (sym == NULL)
|
||||
return -1;
|
||||
addr = (Elf_Addr)linker_file_lookup_symbol(lf, sym, 1);
|
||||
if (addr == NULL)
|
||||
if (addr == 0)
|
||||
return -1;
|
||||
if (*where != addr)
|
||||
*where = addr;
|
||||
|
@ -58,7 +58,7 @@
|
||||
{ MGETHDR((m),M_DONTWAIT,MT_DATA); \
|
||||
if (m) { \
|
||||
MCLGET((m),M_DONTWAIT); \
|
||||
if( NULL == ((m)->m_flags & M_EXT) ){ \
|
||||
if( 0 == ((m)->m_flags & M_EXT) ){ \
|
||||
m_freem(m); \
|
||||
(m) = NULL; \
|
||||
} \
|
||||
|
@ -68,7 +68,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym)
|
||||
if (sym == NULL)
|
||||
return -1;
|
||||
addr = (Elf_Addr)linker_file_lookup_symbol(lf, sym, 1);
|
||||
if (addr == NULL)
|
||||
if (addr == 0)
|
||||
return -1;
|
||||
addr += addend;
|
||||
if (*where != addr)
|
||||
@ -79,7 +79,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym)
|
||||
if (sym == NULL)
|
||||
return -1;
|
||||
addr = (Elf_Addr)linker_file_lookup_symbol(lf, sym, 1);
|
||||
if (addr == NULL)
|
||||
if (addr == 0)
|
||||
return -1;
|
||||
addr += addend - (Elf_Addr)where;
|
||||
if (*where != addr)
|
||||
@ -99,7 +99,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym)
|
||||
if (sym == NULL)
|
||||
return -1;
|
||||
addr = (Elf_Addr)linker_file_lookup_symbol(lf, sym, 1);
|
||||
if (addr == NULL)
|
||||
if (addr == 0)
|
||||
return -1;
|
||||
if (*where != addr)
|
||||
*where = addr;
|
||||
|
@ -467,7 +467,7 @@ link_aout_lookup_symbol(linker_file_t file, const char* name,
|
||||
char* cp;
|
||||
|
||||
if (LD_BUCKETS(af->dynamic) == 0)
|
||||
return NULL;
|
||||
return 0;
|
||||
|
||||
hashbase = AOUT_RELOC(af, struct rrs_hash, LD_HASH(af->dynamic));
|
||||
symbolbase = AOUT_RELOC(af, struct nzlist, LD_SYMBOL(af->dynamic));
|
||||
|
@ -662,7 +662,7 @@ in_pcbnotify(head, dst, fport_arg, laddr, lport_arg, cmd, notify)
|
||||
s = splnet();
|
||||
for (inp = head->lh_first; inp != NULL;) {
|
||||
#ifdef INET6
|
||||
if ((inp->inp_vflag & INP_IPV4) == NULL) {
|
||||
if ((inp->inp_vflag & INP_IPV4) == 0) {
|
||||
inp = LIST_NEXT(inp, inp_list);
|
||||
continue;
|
||||
}
|
||||
@ -759,7 +759,7 @@ in_pcblookup_local(pcbinfo, laddr, lport_arg, wild_okay)
|
||||
head = &pcbinfo->hashbase[INP_PCBHASH(INADDR_ANY, lport, 0, pcbinfo->hashmask)];
|
||||
for (inp = head->lh_first; inp != NULL; inp = inp->inp_hash.le_next) {
|
||||
#ifdef INET6
|
||||
if ((inp->inp_vflag & INP_IPV4) == NULL)
|
||||
if ((inp->inp_vflag & INP_IPV4) == 0)
|
||||
continue;
|
||||
#endif
|
||||
if (inp->inp_faddr.s_addr == INADDR_ANY &&
|
||||
@ -800,7 +800,7 @@ in_pcblookup_local(pcbinfo, laddr, lport_arg, wild_okay)
|
||||
inp = inp->inp_portlist.le_next) {
|
||||
wildcard = 0;
|
||||
#ifdef INET6
|
||||
if ((inp->inp_vflag & INP_IPV4) == NULL)
|
||||
if ((inp->inp_vflag & INP_IPV4) == 0)
|
||||
continue;
|
||||
#endif
|
||||
if (inp->inp_faddr.s_addr != INADDR_ANY)
|
||||
@ -849,7 +849,7 @@ in_pcblookup_hash(pcbinfo, faddr, fport_arg, laddr, lport_arg, wildcard,
|
||||
head = &pcbinfo->hashbase[INP_PCBHASH(faddr.s_addr, lport, fport, pcbinfo->hashmask)];
|
||||
for (inp = head->lh_first; inp != NULL; inp = inp->inp_hash.le_next) {
|
||||
#ifdef INET6
|
||||
if ((inp->inp_vflag & INP_IPV4) == NULL)
|
||||
if ((inp->inp_vflag & INP_IPV4) == 0)
|
||||
continue;
|
||||
#endif
|
||||
if (inp->inp_faddr.s_addr == faddr.s_addr &&
|
||||
@ -871,7 +871,7 @@ in_pcblookup_hash(pcbinfo, faddr, fport_arg, laddr, lport_arg, wildcard,
|
||||
head = &pcbinfo->hashbase[INP_PCBHASH(INADDR_ANY, lport, 0, pcbinfo->hashmask)];
|
||||
for (inp = head->lh_first; inp != NULL; inp = inp->inp_hash.le_next) {
|
||||
#ifdef INET6
|
||||
if ((inp->inp_vflag & INP_IPV4) == NULL)
|
||||
if ((inp->inp_vflag & INP_IPV4) == 0)
|
||||
continue;
|
||||
#endif
|
||||
if (inp->inp_faddr.s_addr == INADDR_ANY &&
|
||||
|
@ -251,7 +251,7 @@ udp_input(m, off, proto)
|
||||
#endif
|
||||
LIST_FOREACH(inp, &udb, inp_list) {
|
||||
#ifdef INET6
|
||||
if ((inp->inp_vflag & INP_IPV4) == NULL)
|
||||
if ((inp->inp_vflag & INP_IPV4) == 0)
|
||||
continue;
|
||||
#endif
|
||||
if (inp->inp_lport != uh->uh_dport)
|
||||
|
@ -1070,7 +1070,7 @@ icmp6_rip6_input(mp, off)
|
||||
|
||||
LIST_FOREACH(in6p, &ripcb, inp_list)
|
||||
{
|
||||
if ((in6p->inp_vflag & INP_IPV6) == NULL)
|
||||
if ((in6p->inp_vflag & INP_IPV6) == 0)
|
||||
continue;
|
||||
if (in6p->in6p_ip6_nxt != IPPROTO_ICMPV6)
|
||||
continue;
|
||||
|
@ -801,7 +801,7 @@ in6_mapped_sockaddr(struct socket *so, struct sockaddr **nam)
|
||||
return EINVAL;
|
||||
if (inp->inp_vflag & INP_IPV4) {
|
||||
error = in_setsockaddr(so, nam);
|
||||
if (error == NULL)
|
||||
if (error == 0)
|
||||
in6_sin_2_v4mapsin6_in_sock(nam);
|
||||
} else
|
||||
error = in6_setsockaddr(so, nam);
|
||||
@ -819,7 +819,7 @@ in6_mapped_peeraddr(struct socket *so, struct sockaddr **nam)
|
||||
return EINVAL;
|
||||
if (inp->inp_vflag & INP_IPV4) {
|
||||
error = in_setpeeraddr(so, nam);
|
||||
if (error == NULL)
|
||||
if (error == 0)
|
||||
in6_sin_2_v4mapsin6_in_sock(nam);
|
||||
} else
|
||||
error = in6_setpeeraddr(so, nam);
|
||||
@ -875,7 +875,7 @@ in6_pcbnotify(head, dst, fport_arg, laddr6, lport_arg, cmd, notify)
|
||||
errno = inet6ctlerrmap[cmd];
|
||||
s = splnet();
|
||||
for (inp = LIST_FIRST(head); inp != NULL;) {
|
||||
if ((inp->inp_vflag & INP_IPV6) == NULL) {
|
||||
if ((inp->inp_vflag & INP_IPV6) == 0) {
|
||||
inp = LIST_NEXT(inp, inp_list);
|
||||
continue;
|
||||
}
|
||||
@ -919,7 +919,7 @@ in6_pcblookup_local(pcbinfo, laddr, lport_arg, wild_okay)
|
||||
head = &pcbinfo->hashbase[INP_PCBHASH(INADDR_ANY, lport, 0,
|
||||
pcbinfo->hashmask)];
|
||||
LIST_FOREACH(inp, head, inp_hash) {
|
||||
if ((inp->inp_vflag & INP_IPV6) == NULL)
|
||||
if ((inp->inp_vflag & INP_IPV6) == 0)
|
||||
continue;
|
||||
if (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr) &&
|
||||
IN6_ARE_ADDR_EQUAL(&inp->in6p_laddr, laddr) &&
|
||||
@ -957,7 +957,7 @@ in6_pcblookup_local(pcbinfo, laddr, lport_arg, wild_okay)
|
||||
*/
|
||||
LIST_FOREACH(inp, &phd->phd_pcblist, inp_portlist) {
|
||||
wildcard = 0;
|
||||
if ((inp->inp_vflag & INP_IPV6) == NULL)
|
||||
if ((inp->inp_vflag & INP_IPV6) == 0)
|
||||
continue;
|
||||
if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr))
|
||||
wildcard++;
|
||||
@ -1060,7 +1060,7 @@ in6_pcblookup_hash(pcbinfo, faddr, fport_arg, laddr, lport_arg, wildcard, ifp)
|
||||
lport, fport,
|
||||
pcbinfo->hashmask)];
|
||||
LIST_FOREACH(inp, head, inp_hash) {
|
||||
if ((inp->inp_vflag & INP_IPV6) == NULL)
|
||||
if ((inp->inp_vflag & INP_IPV6) == 0)
|
||||
continue;
|
||||
if (IN6_ARE_ADDR_EQUAL(&inp->in6p_faddr, faddr) &&
|
||||
IN6_ARE_ADDR_EQUAL(&inp->in6p_laddr, laddr) &&
|
||||
@ -1078,7 +1078,7 @@ in6_pcblookup_hash(pcbinfo, faddr, fport_arg, laddr, lport_arg, wildcard, ifp)
|
||||
head = &pcbinfo->hashbase[INP_PCBHASH(INADDR_ANY, lport, 0,
|
||||
pcbinfo->hashmask)];
|
||||
LIST_FOREACH(inp, head, inp_hash) {
|
||||
if ((inp->inp_vflag & INP_IPV6) == NULL)
|
||||
if ((inp->inp_vflag & INP_IPV6) == 0)
|
||||
continue;
|
||||
if (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr) &&
|
||||
inp->inp_lport == lport) {
|
||||
|
@ -1161,10 +1161,10 @@ ip6_ctloutput(so, sopt)
|
||||
struct mbuf *m;
|
||||
|
||||
error = soopt_getm(sopt, &m); /* XXX */
|
||||
if (error != NULL)
|
||||
if (error != 0)
|
||||
break;
|
||||
error = soopt_mcopyin(sopt, m); /* XXX */
|
||||
if (error != NULL)
|
||||
if (error != 0)
|
||||
break;
|
||||
return (ip6_pcbopts(&in6p->in6p_outputopts,
|
||||
m, so, sopt));
|
||||
@ -2100,7 +2100,7 @@ ip6_mloopback(ifp, m, dst)
|
||||
|
||||
copym = m_copy(m, 0, M_COPYALL);
|
||||
if (copym != NULL) {
|
||||
(void)if_simloop(ifp, copym, (struct sockaddr *)dst, NULL);
|
||||
(void)if_simloop(ifp, copym, (struct sockaddr *)dst, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -226,7 +226,7 @@ udp6_input(mp, offp, proto)
|
||||
*/
|
||||
last = NULL;
|
||||
LIST_FOREACH(in6p, &udb, inp_list) {
|
||||
if ((in6p->inp_vflag & INP_IPV6) == NULL)
|
||||
if ((in6p->inp_vflag & INP_IPV6) == 0)
|
||||
continue;
|
||||
if (in6p->in6p_lport != uh->uh_dport)
|
||||
continue;
|
||||
@ -407,6 +407,7 @@ udp6_ctlinput(cmd, sa, d)
|
||||
sa->sa_len != sizeof(struct sockaddr_in6))
|
||||
return;
|
||||
|
||||
off = 0;
|
||||
if (!PRC_IS_REDIRECT(cmd) &&
|
||||
((unsigned)cmd >= PRC_NCMDS || inet6ctlerrmap[cmd] == 0))
|
||||
return;
|
||||
@ -665,7 +666,7 @@ udp6_bind(struct socket *so, struct sockaddr *nam, struct proc *p)
|
||||
|
||||
inp->inp_vflag &= ~INP_IPV4;
|
||||
inp->inp_vflag |= INP_IPV6;
|
||||
if (ip6_mapped_addr_on && (inp->inp_flags & IN6P_BINDV6ONLY) == NULL) {
|
||||
if (ip6_mapped_addr_on && (inp->inp_flags & IN6P_BINDV6ONLY) == 0) {
|
||||
struct sockaddr_in6 *sin6_p;
|
||||
|
||||
sin6_p = (struct sockaddr_in6 *)nam;
|
||||
@ -714,7 +715,7 @@ udp6_connect(struct socket *so, struct sockaddr *nam, struct proc *p)
|
||||
s = splnet();
|
||||
error = in_pcbconnect(inp, (struct sockaddr *)&sin, p);
|
||||
splx(s);
|
||||
if (error == NULL) {
|
||||
if (error == 0) {
|
||||
inp->inp_vflag |= INP_IPV4;
|
||||
inp->inp_vflag &= ~INP_IPV6;
|
||||
soisconnected(so);
|
||||
@ -733,7 +734,7 @@ udp6_connect(struct socket *so, struct sockaddr *nam, struct proc *p)
|
||||
(htonl(ip6_flow_seq++) & IPV6_FLOWLABEL_MASK);
|
||||
}
|
||||
splx(s);
|
||||
if (error == NULL) {
|
||||
if (error == 0) {
|
||||
if (ip6_mapped_addr_on) { /* should be non mapped addr */
|
||||
inp->inp_vflag &= ~INP_IPV4;
|
||||
inp->inp_vflag |= INP_IPV6;
|
||||
|
@ -58,7 +58,7 @@
|
||||
{ MGETHDR((m),M_DONTWAIT,MT_DATA); \
|
||||
if (m) { \
|
||||
MCLGET((m),M_DONTWAIT); \
|
||||
if( NULL == ((m)->m_flags & M_EXT) ){ \
|
||||
if( 0 == ((m)->m_flags & M_EXT) ){ \
|
||||
m_freem(m); \
|
||||
(m) = NULL; \
|
||||
} \
|
||||
|
@ -1106,7 +1106,7 @@ ffs_clusteralloc(ip, cg, bpref, len)
|
||||
|
||||
fs = ip->i_fs;
|
||||
if (fs->fs_maxcluster[cg] < len)
|
||||
return (NULL);
|
||||
return (0);
|
||||
if (bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), (int)fs->fs_cgsize,
|
||||
NOCRED, &bp))
|
||||
goto fail;
|
||||
|
Loading…
Reference in New Issue
Block a user