Merge "minijail: add no-preload run_pid_pipes unittest"
diff --git a/gen_constants.sh b/gen_constants.sh
index 5175d15..7b39156 100755
--- a/gen_constants.sh
+++ b/gen_constants.sh
@@ -39,9 +39,9 @@
 # #ifdef AT_FDCWD
 #   { "AT_FDWCD", AT_FDCWD },
 # endif
-SED_MULTILINE='s/#define \([A-Z][A-Z0-9_]*\).*/#ifdef \1\
+SED_MULTILINE='s@#define ([[:upper:]][[:upper:]0-9_]*).*@#ifdef \1\
   { "\1", \1 },\
-#endif  \/\/ \1/'
+#endif  // \1@'
 
 # Passes the previous list of #includes to the C preprocessor and prints out
 # all #defines whose name is all-caps.  Excludes a few symbols that are known
@@ -54,11 +54,10 @@
 const struct constant_entry constant_table[] = {
 $(echo "$INCLUDES" | \
   ${CC} -dD - -E | \
-  grep '^#define [A-Z][A-Z0-9_]* ' | \
-  grep -v '\(SIGRTMAX\|SIGRTMIN\|SIG_\|NULL\)' | \
-  sort | \
-  uniq | \
-  sed -e "${SED_MULTILINE}")
+  grep '^#define [[:upper:]][[:upper:]0-9_]* ' | \
+  grep -Ev '(SIGRTMAX|SIGRTMIN|SIG_|NULL)' | \
+  sort -u | \
+  sed -Ee "${SED_MULTILINE}")
   { NULL, 0 },
 };
 EOF
diff --git a/gen_syscalls.sh b/gen_syscalls.sh
index 1e4039b..579f8bc 100755
--- a/gen_syscalls.sh
+++ b/gen_syscalls.sh
@@ -31,7 +31,7 @@
 # #ifdef __NR_read
 #  { "read", __NR_read },
 # #endif
-SED_MULTILINE='s/#define __(ARM_)?(NR_)([a-z0-9_]*) (.*)$/#ifdef __\1\2\3\
+SED_MULTILINE='s/#define __(ARM_)?(NR_)([[:lower:]0-9_]*) (.*)$/#ifdef __\1\2\3\
 { "\1\3", __\1\2\3 },\
 #endif/g p;'