On 04/09/2014 07:20 PM, Hristo Venev wrote: > On Wed, 2014-04-09 at 15:04 +0200, Daniel Mack wrote: >> Eh. Thanks for spotting this. However, I think we should have a compat >> workaround for 3.14, for at least a couple of weeks. We can drop it >> after that. Could you amend your patch for that? > > How do I check if the kernel version is 3.14.0 or 3.14.0+? > linux/version.h is the same. I've amended the patch to check for 3.15.0 > so it will be broken until the release of 3.15.0-rc1. > >> Apart from that, please take care to follow the kernel CodingStyle. In >> particular, we use tabs for indentation, not spaces. > > Done.
Thanks, applied with a small style fixup: I moved the # characters to the first column. Thanks, Daniel > > --- > metadata.c | 26 +++++++++++++++++++------- > 1 file changed, 19 insertions(+), 7 deletions(-) > > diff --git a/metadata.c b/metadata.c > index 5b47bb2..1dab96e 100644 > --- a/metadata.c > +++ b/metadata.c > @@ -23,6 +23,7 @@ > #include <linux/sizes.h> > #include <linux/slab.h> > #include <linux/uaccess.h> > +#include <linux/version.h> > > #include "connection.h" > #include "message.h" > @@ -335,18 +336,29 @@ static int kdbus_meta_append_caps(struct > kdbus_meta *meta) > #ifdef CONFIG_CGROUPS > static int kdbus_meta_append_cgroup(struct kdbus_meta *meta) > { > - char *tmp; > + char *buf, *path; > int ret; > > - tmp = (char *)__get_free_page(GFP_TEMPORARY | __GFP_ZERO); > - if (!tmp) > + buf = (char *)__get_free_page(GFP_TEMPORARY | __GFP_ZERO); > + if (!buf) > return -ENOMEM; > > - ret = task_cgroup_path(current, tmp, PAGE_SIZE); > - if (ret >= 0) > - ret = kdbus_meta_append_str(meta, KDBUS_ITEM_CGROUP, tmp); > + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0) > + path = task_cgroup_path(current, buf, PAGE_SIZE); > + #else > + ret = task_cgroup_path(current, buf, PAGE_SIZE); > + if (ret < 0) > + path = NULL; > + else > + path = buf; > + #endif > > - free_page((unsigned long) tmp); > + if (path) > + ret = kdbus_meta_append_str(meta, KDBUS_ITEM_CGROUP, path); > + else > + ret = -ENAMETOOLONG; > + > + free_page((unsigned long) buf); > > return ret; > } > _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel