From 60304592b96414b9d84a919262e4b2daf1a954fb Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Sun, 22 Mar 2015 17:09:24 -0500 Subject: 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 Reviewed-by: Simon Glass --- test/dm/eth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') 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 */ -- cgit v1.2.3