OpenBSD: fix FTBS on misspelled and missing variables

../xf86drm.c:4622:9: error: use of undeclared identifier 'written'; did you mean 'write'?
    if (written + 1 > max_node_length)
        ^~~~~~~
        write

../xf86drm.c:4624:21: error: use of undeclared identifier 'sbuf'; did you mean 'sbrk'?
    if (stat(node, &sbuf))
                    ^~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-06-19 13:48:57 +02:00
parent 7f20912b1b
commit 0cd18d0dfb

View file

@ -4595,6 +4595,7 @@ drm_public int drmGetDeviceFromDevId(dev_t find_rdev, uint32_t flags, drmDeviceP
int node_type, subsystem_type;
int maj, min, n, ret;
const int max_node_length = ALIGN(drmGetMaxNodeName(), sizeof(void *));
struct stat sbuf;
if (device == NULL)
return -EINVAL;
@ -4619,8 +4620,8 @@ drm_public int drmGetDeviceFromDevId(dev_t find_rdev, uint32_t flags, drmDeviceP
n = snprintf(node, PATH_MAX, dev_name, DRM_DIR_NAME, min);
if (n == -1 || n >= PATH_MAX)
return -errno;
if (written + 1 > max_node_length)
return -EINVAL
if (n + 1 > max_node_length)
return -EINVAL;
if (stat(node, &sbuf))
return -EINVAL;