diff options
author | Joan Lledó <joanlluislledo@gmail.com> | 2019-03-31 19:55:39 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2019-03-31 20:01:39 +0200 |
commit | ef29551e773fd047f855c0922f002d67f18c1ca8 (patch) | |
tree | 6cd56aaec52f45b87dab83590115ae3fa4a72c26 /lwip/port/netif/hurdtunif.c | |
parent | 79c0f932c5465971b1de55672901b5920bab3c6b (diff) | |
download | hurd-ef29551e773fd047f855c0922f002d67f18c1ca8.tar.gz hurd-ef29551e773fd047f855c0922f002d67f18c1ca8.tar.bz2 hurd-ef29551e773fd047f855c0922f002d67f18c1ca8.zip |
lwip: Use the right error type.
Use lwip's err_t as return type for functions called from lwip
and error_t for functions called from the translator.
* lwip/io-ops.c: Include <errno.h>
* as is not being included for other headers anymore.
* lwip/lwip-util.h: Likewise.
* lwip/port/include/netif/hurdethif.h:
* Include <errno.h>
* Change the return type of the init function to err_t.
* lwip/port/include/netif/hurdloopif.h: Liekwise.
* lwip/port/include/netif/hurdtunif.h: Likewise.
* lwip/port/include/netif/ifcommon.h: Likewise.
* lwip/port/netif/ifcommon.c: Likewise.
* lwip/port/netif/hurdloopif.c:
* Include <errno.h>
* Change output function return type to err_t.
* Return lwip's err_t codes.
* lwip/port/netif/hurdethif.c:
* Include <errno.h>
* Change init function return type to err_t.
* Change output function return type to err_t.
* Return lwip's err_t codes.
* lwip/port/netif/hurdtunif.c: Likewise.
Message-Id: <20190331175541.7095-3-jlledom@member.fsf.org>
Diffstat (limited to 'lwip/port/netif/hurdtunif.c')
-rw-r--r-- | lwip/port/netif/hurdtunif.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lwip/port/netif/hurdtunif.c b/lwip/port/netif/hurdtunif.c index d7991baa..80b5280d 100644 --- a/lwip/port/netif/hurdtunif.c +++ b/lwip/port/netif/hurdtunif.c @@ -27,6 +27,7 @@ #include <net/if_arp.h> #include <error.h> #include <sys/mman.h> +#include <errno.h> #include <lwip-hurd.h> @@ -117,11 +118,10 @@ hurdtunif_device_terminate (struct netif *netif) * * Just enqueue the data. */ -static error_t +static err_t hurdtunif_output (struct netif *netif, struct pbuf *p, const ip4_addr_t * ipaddr) { - error_t err = 0; struct hurdtunif *tunif; struct pbuf *pcopy, *oldest; @@ -161,14 +161,14 @@ hurdtunif_output (struct netif *netif, struct pbuf *p, pthread_mutex_unlock (&tunif->lock); - return err; + return ERR_OK; } /* * Set up the tunnel a new tunnel device */ -error_t -hurdtunif_device_init (struct netif * netif) +err_t +hurdtunif_device_init (struct netif *netif) { error_t err = 0; struct hurdtunif *tunif; @@ -229,7 +229,7 @@ hurdtunif_device_init (struct netif * netif) if (tunif->underlying == MACH_PORT_NULL) { error (0, 0, "%s", tunif->comm.devname); - return -1; + return ERR_IF; } err = trivfs_create_control (tunif->underlying, tunnel_cntlclass, @@ -246,7 +246,10 @@ hurdtunif_device_init (struct netif * netif) } if (err) - error (0, err, "%s", tunif->comm.devname); + { + error (0, err, "%s", tunif->comm.devname); + return ERR_IF; + } /* We'll need to get the netif from trivfs operations */ tunif->cntl->hook = netif; @@ -260,7 +263,7 @@ hurdtunif_device_init (struct netif * netif) pthread_cond_init (&tunif->select, NULL); tunif->read_blocked = 0; - return err; + return ERR_OK; } /* |