Skip to content

Commit a198166

Browse files
authored
Merge pull request #297 from dsseng/go1.24-fix
Fix building with Go 1.24
2 parents c03f17e + 1c68019 commit a198166

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/nvcgo/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func main() {}
3232
type CDeviceRule = C.struct_device_rule
3333

3434
// Convert a C-based DeviceRule to a Go-based cgroup.DeviceRule
35-
func (r *CDeviceRule) convert() cgroup.DeviceRule {
35+
func convert(r *CDeviceRule) cgroup.DeviceRule {
3636
return cgroup.DeviceRule{
3737
Allow: bool(r.allow),
3838
Type: C.GoString(r._type),
@@ -67,7 +67,7 @@ func GetDeviceCGroupMountPath(version C.int, procRootPath *C.char, pid C.pid_t,
6767
return -1
6868
}
6969
*cgroupMountPath = C.CString(p)
70-
*cgroupRootPrefix= C.CString(r)
70+
*cgroupRootPrefix = C.CString(r)
7171

7272
return 0
7373
}
@@ -100,7 +100,7 @@ func AddDeviceRules(version C.int, cgroupPath *C.char, crules []CDeviceRule, rer
100100

101101
rules := make([]cgroup.DeviceRule, len(crules))
102102
for i, cr := range crules {
103-
rules[i] = cr.convert()
103+
rules[i] = convert(&cr)
104104
}
105105

106106
err = api.AddDeviceRules(C.GoString(cgroupPath), rules)

0 commit comments

Comments
 (0)