Whamcloud - gitweb
LU-843 iokit: get_ec_devno returns trash
authorMinh Diep <mdiep@whamcloud.com>
Fri, 13 Jan 2012 23:50:42 +0000 (15:50 -0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 6 Feb 2012 23:10:31 +0000 (18:10 -0500)
commit207ba780533dc325f48f7f75c0bfca37d8c545bd
tree0678f3a3d67b35f3ab7ed015ff208b6cbc18cb24
parent4a10a54b89bf963cc2c0811eeb5e33f4d4200dc3
LU-843 iokit: get_ec_devno returns trash

Some commands leak output to stdout and get_ec_devno returns
its results via stdout.  Redirect fd 8 to stdout and redirect
stdout to stderr.  Echo final results to fd 8.  Since this
only works when run as a subshell, invoke "exit" instead of
"return" when done.

Inside create_objects() function, stdin is redirected for a
shell "while" command.  Though this is done in the current
environment (process) for current BASH, it is not required
and there is no committment that BASH will always behave
this way.  Instead, set fd 3 to be reading from that file
and read from fd 3 insted of stdin.

While there, also test for "is object id" lines and extract
values using shell constructs instead of fork-ed commands.

Also while there, ensure that "ERROR" is always printed on
every error exit.

Also while there, ensure that the libecho file comes from
the same directory as the obdfilter-survey script.

Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Change-Id: If6dec690d3aa96f6ddb7fa2994330aae4f89fec0
Reviewed-on: http://review.whamcloud.com/1967
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: wangdi <di.wang@whamcloud.com>
lustre-iokit/obdfilter-survey/libecho
lustre-iokit/obdfilter-survey/obdfilter-survey