third_party_libbpf/scripts/check-reallocarray.sh
David Ahern 29eca541b8 Fix redirect in check-reallocarray (#7)
Builds on debian stretch are failing due to:

../scripts/check-reallocarray.sh: 17: ../scripts/check-reallocarray.sh: Syntax error: Bad fd number

Fix the redirect of stdout and stderr.

Signed-off-by: David Ahern <dsahern@gmail.com>
2019-01-07 20:34:42 -08:00

19 lines
302 B
Bash
Executable File

#!/bin/sh
tfile=$(mktemp /tmp/test_reallocarray_XXXXXXXX.c)
ofile=${tfile%.c}.o
cat > $tfile <<EOL
#define _GNU_SOURCE
#include <stdlib.h>
int main(void)
{
return !!reallocarray(NULL, 1, 1);
}
EOL
gcc $tfile -o $ofile >/dev/null 2>&1
if [ $? -ne 0 ]; then echo "FAIL"; fi
/bin/rm -f $tfile $ofile