Skip to contentSkip to conversation

netlink: Don't change error code signs

PATCH Applied Andrew Zaborowski 2 participants 2 messages Oct 5, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netlink: Don't change error code signs

Netlink errors returned by the kernel are already negative so don't change the sign, this was confusing some iwd code that depends on negative error numbers from l_netlink.

---
 ell/netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ell/netlink.c +1 -1
index d247173..d1871ba 100644
@@ -178,7 +178,7 @@ static void process_message(struct l_netlink *netlink, struct nlmsghdr *nlmsg)
 		case NLMSG_ERROR:
 			err = data + NLMSG_HDRLEN;
 
-			command->handler(-err->error, 0, NULL, 0,
+			command->handler(err->error, 0, NULL, 0,
 							command->user_data);
 			break;
 		}
Signature · 1 line
2.17.1
#1 lore raw

Hi Andrew,

Quoted 7 lines · Andrew Zaborowski

Netlink errors returned by the kernel are already negative so don't change the sign, this was confusing some iwd code that depends on negative error numbers from l_netlink.

---
  ell/netlink.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Regards,
-Denis