jail: don't assume positive return value of creat
[project/procd.git] / make_capabilities_h.sh
1 #!/bin/sh
2
3 CC=$1
4 [ -n "$TARGET_CC_NOCACHE" ] && CC=$TARGET_CC_NOCACHE
5
6 echo "#include <linux/capability.h>"
7 echo "static const char *capabilities_names[] = {"
8 echo "#include <linux/capability.h>" | ${CC} -E -dM - | grep '#define CAP' | grep -vE '(CAP_TO|CAP_LAST_CAP)' | \
9 awk '{print $3" "$2}' | sort -n | awk '{print " ["$1"]\t= \""tolower($2)"\","}'
10 echo "};"