On Tue, Mar 01, 2016 at 08:19:02PM +0100, Cedric Bosdonnat wrote:
On Tue, 2016-03-01 at 13:35 +0100, Pino Toscano wrote:
> On Tuesday 01 March 2016 11:17:19 Cédric Bosdonnat wrote:
[...]
> > + if (asprintf (&p, "%s:/:subvol=%s", device, volume) == -1)
{
> > + perror ("asprintf");
> > + exit (EXIT_FAILURE);
> > + }
> > + } else {
> > + p = guestfs_canonical_device_name (g, fses[i]);
> > + }
>
> Usually there are no curly brackets for blocks of a single
> instruction.
Even if there is a non-single line block in the same if (or else) part?
There's not really a rule on this. As long as the code is clear and
well formatted, then whichever you prefer.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/