Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libc/stdio Make opts.cmd const char * rather than ...



details:   https://anonhg.NetBSD.org/src/rev/4b0eb64979d7
branches:  trunk
changeset: 984475:4b0eb64979d7
user:      kre <kre%NetBSD.org@localhost>
date:      Fri Jul 09 20:00:26 2021 +0000

description:
Make opts.cmd const char * rather than char * -- nothing ever modifies
the string it points to, it is never passed to a function not taking a
const char * arg, and this allows "" (or other literal strings if ever
needed) to be assigned to it - which should fix the build.

diffstat:

 tests/lib/libc/stdio/h_intr.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 2db9ace14b92 -r 4b0eb64979d7 tests/lib/libc/stdio/h_intr.c
--- a/tests/lib/libc/stdio/h_intr.c     Fri Jul 09 19:11:06 2021 +0000
+++ b/tests/lib/libc/stdio/h_intr.c     Fri Jul 09 20:00:26 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: h_intr.c,v 1.3 2021/07/09 15:26:59 christos Exp $      */
+/*     $NetBSD: h_intr.c,v 1.4 2021/07/09 20:00:26 kre Exp $   */
 
 /**
  * Test of interrupted I/O to popen()ed commands.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: h_intr.c,v 1.3 2021/07/09 15:26:59 christos Exp $");
+__RCSID("$NetBSD: h_intr.c,v 1.4 2021/07/09 20:00:26 kre Exp $");
 
 #include <time.h>
 #include <err.h>
@@ -53,7 +53,7 @@
 
 /* Globals */
 static struct options {
-       char* cmd;              /* cmd to run (which must read from stdin) */
+       const char* cmd;        /* cmd to run (which must read from stdin) */
        size_t bsize;           /* block size to use */
        size_t asize;           /* alt. stdio buffer size */
        int btype;              /* buffering type: _IONBF, ... */



Home | Main Index | Thread Index | Old Index