Ticket #1523: patch-preview.txt

File patch-preview.txt, 2.0 KB (added by wish, 5 years ago)

Added by email2trac

Line 
1
2[fix #1523?type=patch:
3William Hay <wish@dumain.com>**20150504152442
4 Ignore-this: 316d5cec9e9495be189019dd47a9246a
5 Submitting via darcs send/trac for ease of application
6] hunk ./source/libs/uti2/sge_cgroup.c 122
7          snprintf((buffer), sizeof(buffer), "%s/%s", (dir), (tail));    \
8    } while(0)
9 
10+static bool half_initialized= false;
11 static bool initialized = false;
12 /* do we have "cpus" or "cpuset.cpus"? */
13 static bool cpuset_prefix = false;
14hunk ./source/libs/uti2/sge_cgroup.c 151
15          if (cg_cpuset == group) {
16             char path[SGE_PATH_MAX], shortbuf[10];
17             size_t l = sizeof shortbuf;
18- -
19+            half_initialized=true;
20             build_path(path, group_dir[group], "cpuset.mems");
21             cpuset_prefix = file_exists(path);
22             if (!cpuset_prefix)
23hunk ./source/libs/uti2/sge_cgroup.c 171
24             if (l <= 1) {
25                WARNING((SGE_EVENT, "Populating "SFN" in " SFN
26                         " so cpusets will work",
27- -                        cpuset_prefix ? "cpuset.mems" : "mems",
28+                        cpuset_prefix ? "cpuset.cpus" : "cpus",
29                         group_dir[group]));
30                copy_from_parent (group_dir[group], "cpus");
31             }
32hunk ./source/libs/uti2/sge_cgroup.c 184
33 char *
34 cgroup_dir(cgroup_t group)
35 {
36- -   if (!initialized) abort();
37+   /*We need to retrieve the cpuset directory part way through the initializtion procedure others can wait*/
38+   if (group==cg_cpuset?!half_initialized:!initialized) abort();
39    return group_dir[group];
40 }
41 
42hunk ./source/libs/uti2/sge_cgroup.c 355
43    /* For some reason we're not getting the glibc version of dirname
44       that doesn't alter its arg.  */
45    sge_strlcpy(dirx, dir, sizeof dirx);
46- -   if (strncmp(dir, cgroup_dir(cg_cpuset), strlen(cgroup_dir(cg_cpuset)))
47+   if (!strncmp(dir, cgroup_dir(cg_cpuset), strlen(cgroup_dir(cg_cpuset)))
48        && cpuset_prefix
49        && strncmp("cpuset.", cfile, 7) != 0)
50       prefix = "cpuset.";
51