mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 17:30:12 +01:00
freedreno/virtio: Use util_get_command_line() helper
Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34846>
This commit is contained in:
parent
1cfe89e3d4
commit
25752d9ac1
1 changed files with 3 additions and 16 deletions
|
|
@ -54,24 +54,11 @@ static void
|
|||
set_debuginfo(struct fd_device *dev)
|
||||
{
|
||||
const char *comm = util_get_process_name();
|
||||
static char cmdline[0x1000+1];
|
||||
int fd = open("/proc/self/cmdline", O_RDONLY);
|
||||
if (fd < 0)
|
||||
static char cmdline[0x1000];
|
||||
|
||||
if (!comm || !util_get_command_line(cmdline, sizeof(cmdline)))
|
||||
return;
|
||||
|
||||
int n = read(fd, cmdline, sizeof(cmdline) - 1);
|
||||
if (n < 0)
|
||||
return;
|
||||
|
||||
/* arguments are separated by NULL, convert to spaces: */
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (cmdline[i] == '\0') {
|
||||
cmdline[i] = ' ';
|
||||
}
|
||||
}
|
||||
|
||||
cmdline[n] = '\0';
|
||||
|
||||
unsigned comm_len = strlen(comm) + 1;
|
||||
unsigned cmdline_len = strlen(cmdline) + 1;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue