mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
st/egl: Fix warning
This commit is contained in:
parent
de89c022d5
commit
78abcb88fe
1 changed files with 7 additions and 1 deletions
|
|
@ -66,10 +66,13 @@ drm_get_device_id(struct drm_device *device)
|
|||
{
|
||||
char path[512];
|
||||
FILE *file;
|
||||
char *ret;
|
||||
|
||||
/* TODO get the real minor */
|
||||
int minor = 0;
|
||||
|
||||
device->deviceID = 0;
|
||||
|
||||
snprintf(path, sizeof(path), "/sys/class/drm/card%d/device/device", minor);
|
||||
file = fopen(path, "r");
|
||||
if (!file) {
|
||||
|
|
@ -77,7 +80,10 @@ drm_get_device_id(struct drm_device *device)
|
|||
return;
|
||||
}
|
||||
|
||||
fgets(path, sizeof( path ), file);
|
||||
ret = fgets(path, sizeof( path ), file);
|
||||
if (!ret)
|
||||
return;
|
||||
|
||||
sscanf(path, "%x", &device->deviceID);
|
||||
fclose(file);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue