From: Karel Zak Date: Thu, 27 Nov 2025 15:50:19 +0000 (+0100) Subject: eject: fix const qualifier warning in read_speed X-Git-Tag: v2.41.3~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=254d583cf77b2db2555c64124c21e643b4162395;p=thirdparty%2Futil-linux.git eject: fix const qualifier warning in read_speed 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 (cherry picked from commit cc1f2ac99b99eede36a58cf115a56bdfbc977e52) --- diff --git a/sys-utils/eject.c b/sys-utils/eject.c index 545642475..e6d4db102 100644 --- a/sys-utils/eject.c +++ b/sys-utils/eject.c @@ -493,7 +493,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");