projects
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libubox: add a package for libblobmsg-json
[openwrt.git]
/
package
/
wprobe
/
src
/
user
/
wprobe-lib.c
diff --git
a/package/wprobe/src/user/wprobe-lib.c
b/package/wprobe/src/user/wprobe-lib.c
index
a3b0fb5
..
7a5460b
100644
(file)
--- a/
package/wprobe/src/user/wprobe-lib.c
+++ b/
package/wprobe/src/user/wprobe-lib.c
@@
-13,6
+13,8
@@
* GNU General Public License for more details.
*/
* GNU General Public License for more details.
*/
+#define _ISOC99_SOURCE
+#define _BSD_SOURCE
#include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
@@
-558,7
+560,9
@@
wprobe_msg_to_network(int socket, struct nl_msg *msg)
mhdr.status = WPROBE_MSG_DATA;
mhdr.len = buflen;
wprobe_swap_msg_hdr(&mhdr);
mhdr.status = WPROBE_MSG_DATA;
mhdr.len = buflen;
wprobe_swap_msg_hdr(&mhdr);
- write(socket, &mhdr, sizeof(mhdr));
+ ret = write(socket, &mhdr, sizeof(mhdr));
+ if (ret < 0)
+ goto out;
memcpy(buf, nlh, buflen);
nlh = buf;
memcpy(buf, nlh, buflen);
nlh = buf;
@@
-570,6
+574,8
@@
wprobe_msg_to_network(int socket, struct nl_msg *msg)
swap_genlmsghdr(gnlh);
swap_nlmsghdr(nlh);
ret = write(socket, buf, buflen);
swap_genlmsghdr(gnlh);
swap_nlmsghdr(nlh);
ret = write(socket, buf, buflen);
+
+out:
free(buf);
return ret;
free(buf);
return ret;
@@
-795,7
+801,8
@@
wprobe_get_auto(const char *arg, char **err)
free(devstr);
return wprobe_get_dev(arg);
#else
free(devstr);
return wprobe_get_dev(arg);
#else
- *err = "Invalid argument";
+ if (err)
+ *err = "Invalid argument";
goto out;
#endif
}
goto out;
#endif
}
This page took
0.040948 seconds
and
4
git commands to generate.