Whamcloud - gitweb
LU-2144 utils: reset 'optind' to avoid segmentation fault
authorFan Yong <yong.fan@whamcloud.com>
Thu, 11 Oct 2012 11:18:16 +0000 (19:18 +0800)
committerOleg Drokin <green@whamcloud.com>
Thu, 11 Oct 2012 23:38:03 +0000 (19:38 -0400)
commit481f78de9f5946e0dcfee2afae75bf0c2804941d
treec21694ff48fac466f4826a3589587ef653219abf
parent979d2e20c91233768e215d81a2f01b85f6270def
LU-2144 utils: reset 'optind' to avoid segmentation fault

Sometimes lfsck_{start,stop} commands may be called several
times under the same lctl shell. Under such case, the function
getopt_long() called inside the lfsck_start/lfsck_stop may be
confused, and cause segmentation fault. So reset the external
variable 'optind' by force to avoid the segmentation fault.

Signed-off-by: Fan Yong <yong.fan@whamcloud.com>
Change-Id: I90c13226101af34948e45959b55752123e77fc9f
Reviewed-on: http://review.whamcloud.com/4251
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/utils/lustre_lfsck.c