Merge pull request #713 from sananya12/nvsandboxutils-sananya

Fix an incompatible pointer conversion in nvsandboxutils
This commit is contained in:
Evan Lezar 2024-09-26 13:12:21 +02:00 committed by GitHub
commit 79c59aeb7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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),