virgl: Replace the usage of os_get_process_name with util_get_process_name

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21034>
This commit is contained in:
Yonggang Luo 2023-02-01 15:14:22 +08:00 committed by Marge Bot
parent b3feb48548
commit 61a7eacf3e

View file

@ -28,8 +28,8 @@
#include <sys/un.h>
#include <unistd.h>
#include <os/os_process.h>
#include <util/format/u_format.h>
#include <util/u_process.h>
#include "virgl_vtest_winsys.h"
#include "virgl_vtest_public.h"
@ -120,10 +120,11 @@ static int virgl_vtest_send_init(struct virgl_vtest_winsys *vws)
uint32_t buf[VTEST_HDR_SIZE];
const char *nstr = "virtest";
char cmdline[64] = { 0 };
int ret;
const char *proc_name = util_get_process_name();
ret = os_get_process_name(cmdline, 63);
if (ret == FALSE)
if (proc_name)
strncpy(cmdline, proc_name, 63);
else
strcpy(cmdline, nstr);
#if defined(HAVE_PROGRAM_INVOCATION_NAME)
if (!strcmp(cmdline, "shader_runner")) {