summaryrefslogtreecommitdiff
path: root/tests/pm_rpm.c
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2015-05-14 14:19:01 +0100
committerDamien Lespiau <damien.lespiau@intel.com>2015-05-15 12:22:14 +0100
commitfd6846c99f00e265f558cf0106c833b96caf977f (patch)
tree44831be4a5e81f6cbbea73e6734dbaf68b99ad14 /tests/pm_rpm.c
parent7a5e1c6f0aebcfabecc3db96cb87add894530326 (diff)
lib: Add a user data pointer to the argument parsing functions
It can be useful to have one of those to carry state between the handler parsing the options and the rest of the test. Right now the only thing we can do is to use global variables for that. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Diffstat (limited to 'tests/pm_rpm.c')
-rw-r--r--tests/pm_rpm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c
index 1a93fe8e..a1f40132 100644
--- a/tests/pm_rpm.c
+++ b/tests/pm_rpm.c
@@ -1791,7 +1791,7 @@ static void fences_subtest(bool dpms)
int rounds = 40;
bool stay = false;
-static int opt_handler(int opt, int opt_index)
+static int opt_handler(int opt, int opt_index, void *data)
{
switch (opt) {
case 'q':
@@ -1819,7 +1819,7 @@ int main(int argc, char *argv[])
};
igt_subtest_init_parse_opts(&argc, argv, "", long_options,
- help_str, opt_handler);
+ help_str, opt_handler, NULL);
/* Skip instead of failing in case the machine is not prepared to reach
* PC8+. We don't want bug reports from cases where the machine is just