Browse Source

nl80211: Fix strerror() value in P2P Dev debug messages

send_and_recv_msgs() returns negative errno, so need to use -ret in the
strerror() call.

Signed-hostap: Jouni Malinen <j@w1.fi>
Jouni Malinen 11 years ago
parent
commit
6cb4f11dba
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/drivers/driver_nl80211.c

+ 2 - 2
src/drivers/driver_nl80211.c

@@ -4004,7 +4004,7 @@ static void nl80211_del_p2pdev(struct i802_bss *bss)
 
 	wpa_printf(MSG_DEBUG, "nl80211: Delete P2P Device %s (0x%llx): %s",
 		   bss->ifname, (long long unsigned int) bss->wdev_id,
-		   strerror(ret));
+		   strerror(-ret));
 
 nla_put_failure:
 	nlmsg_free(msg);
@@ -4034,7 +4034,7 @@ static int nl80211_set_p2pdev(struct i802_bss *bss, int start)
 	wpa_printf(MSG_DEBUG, "nl80211: %s P2P Device %s (0x%llx): %s",
 		   start ? "Start" : "Stop",
 		   bss->ifname, (long long unsigned int) bss->wdev_id,
-		   strerror(ret));
+		   strerror(-ret));
 
 nla_put_failure:
 	nlmsg_free(msg);