Skip to contentSkip to conversation

testdisplay: set a non-zero exit code if getopt detected an error

PATCH New Thomas Wood 1 participant 1 message Jul 25, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 testdisplay: set a non-zero exit code if getopt detected an error

---
 tests/testdisplay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/testdisplay.c +1 -1
index f60e66d..20b0615 100644
@@ -670,7 +670,7 @@ static void __attribute__((noreturn)) usage(char *name)
 	igt_info("\t\t<vdisp>,<vsync-start>,<vsync-end>,<vtotal>\n");
 	igt_info("\t\ttest force mode\n");
 	igt_info("\tDefault is to test all modes.\n");
-	exit(0);
+	exit((optopt) ? -1 : 0);
 }
 
 #define dump_resource(res) if (res) dump_##res()
Signature · 1 line
1.9.3