Skip to content

Commit

Permalink
Fix the example usage in the man manual.
Browse files Browse the repository at this point in the history
The execution result of `memhog -r6 1G --membind 0 -fmemhog.mmap`
in manuals isn't as expected, it directly use the last assignment
of p, "default", not "membind". We remove the '-' character and
then match it.
  • Loading branch information
luochunsheng authored and andikleen committed Aug 25, 2022
1 parent 59a9237 commit 4b4e31d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions util.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ int parse_policy(char *name, char *arg)
struct policy *p = NULL;
if (!name)
return MPOL_DEFAULT;

while (*name == '-') name++;
for (k = 0; policies[k].name; k++) {
p = &policies[k];
if (!strcmp(p->name, name))
Expand Down

0 comments on commit 4b4e31d

Please sign in to comment.