Snap for 4590521 from 8e193ad5123f0929ddb865a49a665f79724f2fa9 to pi-release

Change-Id: I254a78e57704b81ef2341e7a876e2f17d8d0fd17
diff --git a/minijail0_cli_unittest.cc b/minijail0_cli_unittest.cc
index a774d55..2427a01 100644
--- a/minijail0_cli_unittest.cc
+++ b/minijail0_cli_unittest.cc
@@ -42,8 +42,10 @@
   // as it parses things (which is normally permissible with argv).
   int parse_args_(const std::vector<std::string>& argv, int *exit_immediately,
                   ElfType *elftype) {
-    // Make sure we reset the getopts state when scanning a new argv.
-    optind = 1;
+    // Make sure we reset the getopts state when scanning a new argv.  Setting
+    // this to 0 is a GNU extension, but AOSP/BSD also checks this (as an alias
+    // to their "optreset").
+    optind = 0;
 
     std::vector<const char *> pargv;
     pargv.push_back("minijail0");