On Thursday 28 January 2016 13:47:30 Richard W.M. Jones wrote:
On Wed, Jan 27, 2016 at 07:06:46PM +0100, Pino Toscano wrote:
> char **
> do_lvs (void)
> {
> char *out;
> CLEANUP_FREE char *err = NULL;
> int r;
> + int has_S = test_lvs_has_S_opt ();
> + if (has_S < 0)
> return NULL;
I think this doesn't do the right thing on the second failing call
to test_lvs_has_S_opt, because it won't return a protocol error?
test_lvs_has_S_opt caches the result only if != -1, so if executing
"lvm lvs --help" fails then an error is replied and nothing is cached;
next time the command will be tried again.
> + /*NOTREACHED*/
> + assert (false);
> + return NULL;
> }
What's this bit for? It is indeed NOTREACHED, but it seems as if
the 3 lines could just be removed.
It was a simple extra safety belt, since IIRC past versions of GCC
could not recognize such case was indeed not reachable. I guess this
can be added in case it is misreported.
--
Pino Toscano