Added explicit errno reporting from error() API.
[akaros.git] / kern / src / net / nullmedium.c
index dd878e4..4a175e8 100644 (file)
 #include <ip.h>
 
 static void
-nullbind(struct ipifc *unused_ipifc, int unused_int, char **unused_char_pp_t)
+nullbind(struct Ipifc *unused_ipifc, int unused_int, char **unused_char_pp_t)
 {
-       error("cannot bind null device");
+       error(EFAIL, "cannot bind null device");
 }
 
-static void
-nullunbind(struct ipifc *unused_ipifc)
+static void nullunbind(struct Ipifc *unused_ipifc)
 {
 }
 
 static void
-nullbwrite(struct ipifc *unused_ipifc, struct block*, int unused_int, uint8_t *unused_uint8_p_t)
+nullbwrite(struct Ipifc *unused_ipifc, struct block *b, int unused_int,
+                  uint8_t * unused_uint8_p_t)
 {
-       error("nullbwrite");
+       error(EFAIL, "nullbwrite");
 }
 
-struct medium nullmedium =
-{
-.name=         "null",
-.bind=         nullbind,
-.unbind=       nullunbind,
-.bwrite=       nullbwrite,
+struct medium nullmedium = {
+       .name = "null",
+       .bind = nullbind,
+       .unbind = nullunbind,
+       .bwrite = nullbwrite,
 };
 
-void
-nullmediumlink(void)
+void nullmediumlink(void)
 {
        addipmedium(&nullmedium);
 }