mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
examples/usrsocktest: correct return value check of dup2()
DUP(2) Linux Programmer's Manual
NAME
dup, dup2, dup3 - duplicate a file descriptor
...
RETURN VALUE
On success, these system calls return the new file descriptor.
On error, -1 is returned, and errno is set appropriately.
Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
parent
c427f408cb
commit
a8d2924c55
1 changed files with 1 additions and 1 deletions
|
|
@ -333,7 +333,7 @@ static void basic_daemon_dup2(FAR struct usrsocktest_daemon_conf_s *dconf)
|
|||
TEST_ASSERT_EQUAL(2, usrsocktest_daemon_get_num_active_sockets());
|
||||
|
||||
ret = dup2(sd2, sd);
|
||||
TEST_ASSERT_EQUAL(0, ret);
|
||||
TEST_ASSERT_EQUAL(sd, ret);
|
||||
TEST_ASSERT_EQUAL(1, usrsocktest_daemon_get_num_active_sockets());
|
||||
|
||||
ret = close(sd2);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue