Skip to content

Commit 02530be

Browse files
rluboskartben
authored andcommitted
net: zperf: Fix invalid zsock_recv() error check
The return value can only be -1, errno value should be verified instead for the actual error code. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
1 parent a94209b commit 02530be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/net/lib/zperf/zperf_udp_uploader.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static inline int zperf_upload_fin(int sock,
118118
}
119119

120120
ret = zsock_recv(sock, stats, sizeof(stats), 0);
121-
if (ret == -EAGAIN) {
121+
if (ret < 0 && errno == EAGAIN) {
122122
NET_WARN("Stats receive timeout");
123123
} else if (ret < 0) {
124124
NET_ERR("Failed to receive packet (%d)", errno);

0 commit comments

Comments
 (0)