Am 28.03.2010 19:07, schrieb Ryota Ozaki: > - use err(3) instead of errx(3) if errno is available > to report why failed > - let fail prior to daemon(3) if opening a nbd file > is likely to fail after daemonizing to avoid silent > failure exit > - add missing 'ret = 1' when unix_socket_outgoing failed > > Signed-off-by: Ryota Ozaki <ozaki.ry...@gmail.com>
Acked-by: Kevin Wolf <kw...@redhat.com> > @@ -343,25 +343,31 @@ int main(int argc, char **argv) > return 1; > } > > - if (bdrv_open(bs, argv[optind], flags) < 0) { > - return 1; > + if ((ret = bdrv_open(bs, argv[optind], flags)) < 0) { > + errno = -ret; > + err(EXIT_FAILURE, "Failed to bdrv_open '%s'", argv[optind]); > } If you do it like this, you could do the change for even more errors, like the ones returned by bdrv_read. But that doesn't make this patch less correct, of course. Kevin