[Devel] Re: [PATCH 0/4] cgroups: show correct file mode

Paul Menage menage at google.com
Mon Mar 2 16:15:51 PST 2009


On Mon, Mar 2, 2009 at 4:09 PM, KAMEZAWA Hiroyuki
<kamezawa.hiroyu at jp.fujitsu.com> wrote:
>
>        int mode;
>        if (cft->mode)
>                mode = cft->mode;
>        else if (cft->write_xxx || .....)
>                mode = 0644;
>        else
>                mode = 0444;

Almost:

int mode;
if (cft->mode) {
  mode = cft->mode;
} else {
  if (cft->write_xxx || ....)
    mode |= 0600;
  if (cft->read_xxx || ...)
    mode |= 0444;
}

Paul
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list