Usermode/dhcpclient - Added echo of error string when write fails
authorJohn Hodge <[email protected]>
Mon, 15 Jul 2013 02:16:04 +0000 (10:16 +0800)
committerJohn Hodge <[email protected]>
Mon, 15 Jul 2013 02:16:04 +0000 (10:16 +0800)
Usermode/Applications/dhcpclient_src/main.c

index ff326b0..5fc0be4 100644 (file)
@@ -8,6 +8,7 @@
 #include <stdlib.h>
 #include <net.h>
 #include <acess/sys.h>
+#include <errno.h>
 
 enum {
        UDP_IOCTL_GETSETLPORT = 4,
@@ -316,7 +317,8 @@ void Send_DHCPDISCOVER(tInterface *Iface)
 
        i = _SysWrite(Iface->SocketFD, data, sizeof(data));
        if( i != sizeof(data) ) {
-               _SysDebug("_SysWrite failed (%i != %i)", i, sizeof(data));
+               _SysDebug("_SysWrite failed (%i != %i): %s", i, sizeof(data),
+                       strerror(errno));
        }
        Update_State(Iface, STATE_DISCOVER_SENT);
 }

UCC git Repository :: git.ucc.asn.au