Skip to content

Commit 23ac159

Browse files
ianlancetaylorgopherbot
authored andcommitted
net: don't return errno from _C_res_nsearch
We ignore the value anyhow. Change-Id: I1b1db7831c42bf852652236212812fd5cf258530 Reviewed-on: https://go-review.googlesource.com/c/go/+/457439 Reviewed-by: Damien Neil <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent d3d3909 commit 23ac159

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

src/net/cgo_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ func cgoResSearch(hostname string, rtype, class int) ([]dnsmessage.Resource, err
352352

353353
var size int
354354
for {
355-
size, _ = _C_res_nsearch(state, (*_C_char)(unsafe.Pointer(s)), class, rtype, buf, bufSize)
355+
size := _C_res_nsearch(state, (*_C_char)(unsafe.Pointer(s)), class, rtype, buf, bufSize)
356356
if size <= 0 || size > 0xffff {
357357
return nil, errors.New("res_nsearch failure")
358358
}

src/net/cgo_unix_cgo_res.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func _C_res_nclose(state *_C_struct___res_state) {
3232
return
3333
}
3434

35-
func _C_res_nsearch(state *_C_struct___res_state, dname *_C_char, class, typ int, ans *_C_uchar, anslen int) (int, error) {
36-
x, err := C.res_search(dname, C.int(class), C.int(typ), ans, C.int(anslen))
37-
return int(x), err
35+
func _C_res_nsearch(state *_C_struct___res_state, dname *_C_char, class, typ int, ans *_C_uchar, anslen int) int {
36+
x := C.res_search(dname, C.int(class), C.int(typ), ans, C.int(anslen))
37+
return int(x)
3838
}

src/net/cgo_unix_cgo_resn.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func _C_res_nclose(state *_C_struct___res_state) {
3333
C.res_nclose(state)
3434
}
3535

36-
func _C_res_nsearch(state *_C_struct___res_state, dname *_C_char, class, typ int, ans *_C_uchar, anslen int) (int, error) {
37-
x, err := C.res_nsearch(state, dname, C.int(class), C.int(typ), ans, C.int(anslen))
38-
return int(x), err
36+
func _C_res_nsearch(state *_C_struct___res_state, dname *_C_char, class, typ int, ans *_C_uchar, anslen int) int {
37+
x := C.res_nsearch(state, dname, C.int(class), C.int(typ), ans, C.int(anslen))
38+
return int(x)
3939
}

src/net/cgo_unix_syscall.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ func _C_res_ninit(state *_C_struct___res_state) error {
7373
return nil
7474
}
7575

76-
func _C_res_nsearch(state *_C_struct___res_state, dname *_C_char, class, typ int, ans *_C_char, anslen int) (int, error) {
77-
return unix.ResNsearch(state, dname, class, typ, ans, anslen)
76+
func _C_res_nsearch(state *_C_struct___res_state, dname *_C_char, class, typ int, ans *_C_char, anslen int) int {
77+
x, _ := unix.ResNsearch(state, dname, class, typ, ans, anslen)
78+
return x
7879
}
7980

8081
func _C_res_nclose(state *_C_struct___res_state) {

0 commit comments

Comments
 (0)