mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-22 08:18:32 +00:00
Fix incompatible pointer conversion
This change adds a safe pointer conversion to fix an incompatible C pointer conversion, which caused build failures on some architectures. Signed-off-by: Sananya Majumder <sananyam@nvidia.com>
This commit is contained in:
parent
0e68f60c0b
commit
906531fee3
@ -18,6 +18,7 @@ package nvsandboxutils
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
import "C"
|
import "C"
|
||||||
@ -54,7 +55,7 @@ func (l *library) GetGpuResource(uuid string) ([]GpuFileInfo, Ret) {
|
|||||||
var fileInfos []GpuFileInfo
|
var fileInfos []GpuFileInfo
|
||||||
for fileInfo := request.Files; fileInfo != nil; fileInfo = fileInfo.Next {
|
for fileInfo := request.Files; fileInfo != nil; fileInfo = fileInfo.Next {
|
||||||
fi := GpuFileInfo{
|
fi := GpuFileInfo{
|
||||||
Path: C.GoString((*C.char)(fileInfo.FilePath)),
|
Path: C.GoString((*C.char)(unsafe.Pointer(fileInfo.FilePath))),
|
||||||
Type: FileType(fileInfo.FileType),
|
Type: FileType(fileInfo.FileType),
|
||||||
SubType: FileSystemSubType(fileInfo.FileSubType),
|
SubType: FileSystemSubType(fileInfo.FileSubType),
|
||||||
Module: FileModule(fileInfo.Module),
|
Module: FileModule(fileInfo.Module),
|
||||||
|
Loading…
Reference in New Issue
Block a user