loopback: Return a More Descriptive Error Code
authorGrant Erickson <marathon96@gmail.com>
Fri, 15 Jul 2011 17:21:31 +0000 (10:21 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 15 Jul 2011 20:32:28 +0000 (22:32 +0200)
Return a more descriptive -errno rather than -1 when we fail to create
a socket.

plugins/loopback.c

index 6cd5b85..ba8f51a 100644 (file)
@@ -220,7 +220,7 @@ static int setup_loopback(void)
 
        sk = socket(PF_INET, SOCK_DGRAM, 0);
        if (sk < 0)
-               return -1;
+               return -errno;
 
        memset(&ifr, 0, sizeof(ifr));
        strcpy(ifr.ifr_name, "lo");