* @ingroup netconn_common * Get and reset pending error on a netconn * * @param conn the netconn to get the error from * @return and pending error or ERR_OK if no error was pending */
| 1136 | * @return and pending error or ERR_OK if no error was pending |
| 1137 | */ |
| 1138 | err_t |
| 1139 | netconn_err(struct netconn *conn) |
| 1140 | { |
| 1141 | err_t err; |
| 1142 | SYS_ARCH_DECL_PROTECT(lev); |
| 1143 | if (conn == NULL) { |
| 1144 | return ERR_OK; |
| 1145 | } |
| 1146 | SYS_ARCH_PROTECT(lev); |
| 1147 | err = conn->pending_err; |
| 1148 | conn->pending_err = ERR_OK; |
| 1149 | SYS_ARCH_UNPROTECT(lev); |
| 1150 | return err; |
| 1151 | } |
| 1152 | |
| 1153 | /** |
| 1154 | * @ingroup netconn_tcp |
no outgoing calls
no test coverage detected