Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame^] | 1 | Avoid using keyword restrict as variable name which causes error with gcc 5.x: |
| 2 | |
| 3 | | hugeutils.c: In function '__lh_hugetlbfs_setup_env': |
| 4 | | hugeutils.c:304:40: error: expected identifier or '(' before 'restrict' |
| 5 | | char *p, *tok, *exe, buf[MAX_EXE+1], restrict[MAX_EXE]; |
| 6 | | ^ |
| 7 | |
| 8 | Upstream-Status: Pending |
| 9 | |
| 10 | Signed-off-by: Kai Kang <kai.kang@windriver.com> |
| 11 | --- |
| 12 | diff --git a/hugeutils.c b/hugeutils.c |
| 13 | index 53a7fbd..b9d7001 100644 |
| 14 | --- a/hugeutils.c |
| 15 | +++ b/hugeutils.c |
| 16 | @@ -301,14 +301,14 @@ void hugetlbfs_setup_env() |
| 17 | |
| 18 | env = getenv("HUGETLB_RESTRICT_EXE"); |
| 19 | if (env) { |
| 20 | - char *p, *tok, *exe, buf[MAX_EXE+1], restrict[MAX_EXE]; |
| 21 | + char *p, *tok, *exe, buf[MAX_EXE+1], restricted[MAX_EXE]; |
| 22 | int found = 0; |
| 23 | |
| 24 | exe = get_exe_name(buf, sizeof buf); |
| 25 | DEBUG("Found HUGETLB_RESTRICT_EXE, this exe is \"%s\"\n", exe); |
| 26 | - strncpy(restrict, env, sizeof restrict); |
| 27 | - restrict[sizeof(restrict)-1] = 0; |
| 28 | - for (p = restrict; (tok = strtok(p, ":")) != NULL; p = NULL) { |
| 29 | + strncpy(restricted, env, sizeof restricted); |
| 30 | + restricted[sizeof(restricted)-1] = 0; |
| 31 | + for (p = restricted; (tok = strtok(p, ":")) != NULL; p = NULL) { |
| 32 | DEBUG(" ...check exe match for \"%s\"\n", tok); |
| 33 | if (strcmp(tok, exe) == 0) { |
| 34 | found = 1; |