linux: include sys/socket.h in linux/vm_sockets.h

The header requires struct sockaddr declared. So, otherwise, we need to
include sys/socket.h earlier than linux/vm_sockets.h.
Let's make the header includable at any place.
This commit is contained in:
Yu Watanabe
2025-04-30 07:37:34 +02:00
committed by Daan De Meyer
parent 3a03b97d6f
commit 0dc09ccba7
3 changed files with 7 additions and 1 deletions
+4
View File
@@ -29,5 +29,9 @@ for i in *.h */*.h; do
# add casts in ethtool_cmd_speed()
sed -r -i '/return (ep->speed_hi << 16) | ep->speed;/ s/return .*;/return ((__u32) ep->speed_hi << 16) | (__u32) ep->speed;/' "$i"
;;
vm_sockets.h)
# the header requires struct sockaddr declared
sed -r -i '/#define _VM_SOCKETS_H/a \\n#include <sys/socket.h>' "$i"
;;
esac
done
+2
View File
@@ -17,6 +17,8 @@
#ifndef _VM_SOCKETS_H
#define _VM_SOCKETS_H
#include <sys/socket.h>
#include <linux/socket.h>
#include <linux/types.h>