From: jsg Date: Fri, 30 Jul 2021 04:04:25 +0000 (+0000) Subject: set the name of the allocating process in struct drm_framebuffer X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=dc309f62a07bb9f5589f173b35ac06ee5e7a60ee;p=openbsd set the name of the allocating process in struct drm_framebuffer --- diff --git a/sys/dev/pci/drm/drm_fb_helper.c b/sys/dev/pci/drm/drm_fb_helper.c index 29ee15aaa18..fc17044fc84 100644 --- a/sys/dev/pci/drm/drm_fb_helper.c +++ b/sys/dev/pci/drm/drm_fb_helper.c @@ -1687,6 +1687,8 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, #ifdef __linux__ strcpy(fb_helper->fb->comm, "[fbcon]"); +#else + strlcpy(fb_helper->fb->comm, "[fbcon]", sizeof(fb_helper->fb->comm)); #endif return 0; } diff --git a/sys/dev/pci/drm/drm_framebuffer.c b/sys/dev/pci/drm/drm_framebuffer.c index 239bf76b699..a6ae8b3626f 100644 --- a/sys/dev/pci/drm/drm_framebuffer.c +++ b/sys/dev/pci/drm/drm_framebuffer.c @@ -852,8 +852,10 @@ int drm_framebuffer_init(struct drm_device *dev, struct drm_framebuffer *fb, INIT_LIST_HEAD(&fb->filp_head); fb->funcs = funcs; -#ifdef notyet - strlcpy(fb->comm, current->comm, sizeof(fb->comm)); +#ifdef __linux__ + strcpy(fb->comm, current->comm); +#else + strlcpy(fb->comm, curproc->p_p->ps_comm, sizeof(fb->comm)); #endif ret = __drm_mode_object_add(dev, &fb->base, DRM_MODE_OBJECT_FB,