Skip to content

Commit

Permalink
src: use ARES_SUCCESS instead of 0
Browse files Browse the repository at this point in the history
Since error messages are also using defined values, it is more clear
to use the defined value even when the operation succeeds.

PR-URL: nodejs/node#48834
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
  • Loading branch information
sercher committed Apr 25, 2024
1 parent 3b9317d commit 208d856
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions graal-nodejs/src/cares_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ int AnyTraits::Parse(
return status;

wrap->CallOnComplete(ret);
return 0;
return ARES_SUCCESS;
}

int ATraits::Parse(
Expand Down Expand Up @@ -1086,7 +1086,7 @@ int ATraits::Parse(
Local<Array> ttls = AddrTTLToArray<ares_addrttl>(env, addrttls, naddrttls);

wrap->CallOnComplete(ret, ttls);
return 0;
return ARES_SUCCESS;
}

int AaaaTraits::Parse(
Expand Down Expand Up @@ -1120,7 +1120,7 @@ int AaaaTraits::Parse(
Local<Array> ttls = AddrTTLToArray<ares_addr6ttl>(env, addrttls, naddrttls);

wrap->CallOnComplete(ret, ttls);
return 0;
return ARES_SUCCESS;
}

int CaaTraits::Parse(
Expand All @@ -1142,7 +1142,7 @@ int CaaTraits::Parse(
return status;

wrap->CallOnComplete(ret);
return 0;
return ARES_SUCCESS;
}

int CnameTraits::Parse(
Expand All @@ -1165,7 +1165,7 @@ int CnameTraits::Parse(
return status;

wrap->CallOnComplete(ret);
return 0;
return ARES_SUCCESS;
}

int MxTraits::Parse(
Expand All @@ -1188,7 +1188,7 @@ int MxTraits::Parse(
return status;

wrap->CallOnComplete(mx_records);
return 0;
return ARES_SUCCESS;
}

int NsTraits::Parse(
Expand All @@ -1211,7 +1211,7 @@ int NsTraits::Parse(
return status;

wrap->CallOnComplete(names);
return 0;
return ARES_SUCCESS;
}

int TxtTraits::Parse(
Expand All @@ -1233,7 +1233,7 @@ int TxtTraits::Parse(
return status;

wrap->CallOnComplete(txt_records);
return 0;
return ARES_SUCCESS;
}

int SrvTraits::Parse(
Expand All @@ -1255,7 +1255,7 @@ int SrvTraits::Parse(
return status;

wrap->CallOnComplete(srv_records);
return 0;
return ARES_SUCCESS;
}

int PtrTraits::Parse(
Expand All @@ -1279,7 +1279,7 @@ int PtrTraits::Parse(
return status;

wrap->CallOnComplete(aliases);
return 0;
return ARES_SUCCESS;
}

int NaptrTraits::Parse(
Expand All @@ -1301,7 +1301,7 @@ int NaptrTraits::Parse(
return status;

wrap->CallOnComplete(naptr_records);
return 0;
return ARES_SUCCESS;
}

int SoaTraits::Parse(
Expand Down Expand Up @@ -1352,7 +1352,7 @@ int SoaTraits::Parse(
ares_free_data(soa_out);

wrap->CallOnComplete(soa_record);
return 0;
return ARES_SUCCESS;
}

int ReverseTraits::Send(GetHostByAddrWrap* wrap, const char* name) {
Expand Down Expand Up @@ -1396,7 +1396,7 @@ int ReverseTraits::Parse(
HandleScope handle_scope(env->isolate());
Context::Scope context_scope(env->context());
wrap->CallOnComplete(HostentToNames(env, host));
return 0;
return ARES_SUCCESS;
}

namespace {
Expand Down

0 comments on commit 208d856

Please sign in to comment.