Message ID | 20170615182516.4508-8-mgreer@animalcreek.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Samuel Ortiz |
Headers | show |
diff --git a/src/adapter.c b/src/adapter.c index bc29ace..bfc64c2 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -1044,7 +1044,7 @@ int near_adapter_connect(uint32_t idx, uint32_t target_idx, uint8_t protocol) sock = socket(AF_NFC, SOCK_SEQPACKET, NFC_SOCKPROTO_RAW); if (sock == -1) - return sock; + return -errno; addr.sa_family = AF_NFC; addr.dev_idx = idx;
near_adapter_connect() incorrectly returns '-1' when the socket() call fails. Instead, it should return '-errno' which is the real error code. Signed-off-by: Mark Greer <mgreer@animalcreek.com> --- src/adapter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)