]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
eject: fix const qualifier warning in read_speed master
authorKarel Zak <kzak@redhat.com>
Thu, 27 Nov 2025 15:50:19 +0000 (16:50 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 27 Nov 2025 15:50:19 +0000 (16:50 +0100)
Fix const qualifier discarded warning in read_speed().
This warning is reported by gcc 15 which defaults to the C23 standard.

The strrchr() function returns a pointer into a const string, so the
receiving variable must be declared as const char *.

Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/eject.c

index f5d48badb386ac3e8196aa4a86211e652d70f4a3..0debd0df334f3d26a14c1cda0c5ca17103a9af1a 100644 (file)
@@ -492,7 +492,7 @@ static void select_speed(const struct eject_control *ctl)
 static int read_speed(const char *devname)
 {
        int drive_number = -1;
-       char *name;
+       const char *name;
        FILE *f;
 
        f = fopen(_PATH_PROC_CDROMINFO, "r");