[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] [PATCH] mke2fs: Use e4fsprogs programs if available.



...
> +static const char *
> +get_mke2fs (void)
> +{
> +  static const char *progs[] = { "/sbin/mke4fs", "/sbin/mke2fs", NULL };
> +  int i;
> +
> +  for (i = 0; progs[i]; ++i)
> +    if (access (progs[i], F_OK) == 0)
> +      return progs[i];
> +
> +  reply_with_error ("mke2fs: no mke2fs binary found in appliance");
> +  return NULL;
...

All looks good

One nit: you can add one more "const" there,
since it's a const list of const strings:

  static const char *const progs[] = { "/sbin/mke4fs", "/sbin/mke2fs", NULL };


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]