]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vsh: Turn _vshControl::progname into a const string
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 11 Apr 2025 14:40:41 +0000 (16:40 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 14 Apr 2025 10:00:55 +0000 (12:00 +0200)
The aim of the progname member of the _vshControl struct is to
point to argv[0] which is then used in vshOutputLogFile() to
create a prefix for a log message. But the member is never
modified (nor it should be) and thus can be a const char *.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
tools/vsh.h

index 5970addfb6ef26c7a8f4055f36c774932b25f16f..8b87c00ff4bad9faf4017e731345f1a69c57f9fc 100644 (file)
@@ -194,7 +194,7 @@ struct _vshControl {
                                  * to program name */
     const char *env_prefix;     /* hardcoded environment variable prefix */
     char *connname;             /* connection name */
-    char *progname;             /* program name */
+    const char *progname;       /* program name */
     vshCmd *cmd;                /* the current command */
     char *cmdstr;               /* string with command */
     bool imode;                 /* interactive mode? */