summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2015-03-22 17:09:24 -0500
committerSimon Glass <sjg@chromium.org>2015-04-18 11:11:14 -0600
commit60304592b96414b9d84a919262e4b2daf1a954fb (patch)
tree9b74a696268d3cc4539523bfa9bb610ee9905886 /test
parent22f68524f84c3a0d620e787c51d5f244ef8e0aca (diff)
downloadu-boot-60304592b96414b9d84a919262e4b2daf1a954fb.tar.gz
u-boot-60304592b96414b9d84a919262e4b2daf1a954fb.tar.bz2
u-boot-60304592b96414b9d84a919262e4b2daf1a954fb.zip
net: Improve error handling
Take a pass at plumbing errors through to the users of the network stack Currently only the start() function errors will be returned from NetLoop(). recv() tends not to have errors, so that is likely not worth adding. send() certainly can return errors, but this patch does not attempt to plumb them yet. halt() is not expected to error. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/dm/eth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/dm/eth.c b/test/dm/eth.c
index a0e935939f..19236705e2 100644
--- a/test/dm/eth.c
+++ b/test/dm/eth.c
@@ -99,7 +99,7 @@ static int dm_test_eth_rotate(struct dm_test_state *dms)
/* If ethrotate is no, then we should fail on a bad MAC */
setenv("ethact", "eth@10004000");
setenv("ethrotate", "no");
- ut_asserteq(-1, NetLoop(PING));
+ ut_asserteq(-EINVAL, NetLoop(PING));
ut_asserteq_str("eth@10004000", getenv("ethact"));
/* Restore the env */
@@ -144,7 +144,7 @@ static int dm_test_net_retry(struct dm_test_state *dms)
*/
setenv("ethact", "eth@10004000");
setenv("netretry", "no");
- ut_asserteq(-1, NetLoop(PING));
+ ut_asserteq(-ETIMEDOUT, NetLoop(PING));
ut_asserteq_str("eth@10004000", getenv("ethact"));
/* Restore the env */