tty: fix compiler error

At least on tests running on Fedora rawhide following error could be
seen:

```
  criu/tty.c: In function 'pts_fd_get_index':
  criu/tty.c:262:21: error: initialization discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
    262 |         char *pos = strrchr(link->name, '/');
        |
```

This fixes it.

Signed-off-by: Adrian Reber <areber@redhat.com>
This commit is contained in:
Adrian Reber 2025-11-26 13:21:07 +00:00 committed by Radostin Stoyanov
parent 09bb362664
commit 90300748ef

View file

@ -259,7 +259,7 @@ static int pts_fd_get_index(int fd, const struct fd_parms *p)
{ {
int index; int index;
const struct fd_link *link = p->link; const struct fd_link *link = p->link;
char *pos = strrchr(link->name, '/'); const char *pos = strrchr(link->name, '/');
if (!pos || pos == (link->name + link->len - 1)) { if (!pos || pos == (link->name + link->len - 1)) {
pr_err("Unexpected format on path %s\n", link->name + 1); pr_err("Unexpected format on path %s\n", link->name + 1);