Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/crunch/crunchgen Use "r" instead of "r+" to popen(3)...



details:   https://anonhg.NetBSD.org/src/rev/1b5d91aeffdc
branches:  trunk
changeset: 524821:1b5d91aeffdc
user:      lukem <lukem%NetBSD.org@localhost>
date:      Sun Mar 31 07:48:15 2002 +0000

description:
Use "r" instead of "r+" to popen(3), since the latter is not portable
and the I/O stream is only read from in any case. Problem noted and fix
suggested by Ben Harris <bjh21%netbsd.org@localhost> in [toolchain/16139].

diffstat:

 usr.bin/crunch/crunchgen/crunchgen.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 31ef97aca33d -r 1b5d91aeffdc usr.bin/crunch/crunchgen/crunchgen.c
--- a/usr.bin/crunch/crunchgen/crunchgen.c      Sun Mar 31 07:32:18 2002 +0000
+++ b/usr.bin/crunch/crunchgen/crunchgen.c      Sun Mar 31 07:48:15 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crunchgen.c,v 1.33 2002/02/02 12:25:35 lukem Exp $     */
+/*     $NetBSD: crunchgen.c,v 1.34 2002/03/31 07:48:15 lukem Exp $     */
 /*
  * Copyright (c) 1994 University of Maryland
  * All Rights Reserved.
@@ -33,7 +33,7 @@
  */
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: crunchgen.c,v 1.33 2002/02/02 12:25:35 lukem Exp $");
+__RCSID("$NetBSD: crunchgen.c,v 1.34 2002/03/31 07:48:15 lukem Exp $");
 #endif
 
 #if HAVE_CONFIG_H
@@ -622,7 +622,7 @@
     (void)snprintf(line, sizeof(line),
        "cd %s && %s CRUNCHEDPROG=1 -f %s %s crunchgen_objs 2>&1", dirpath,
        makebin, tempfname, makeflags);
-    if((f = popen(line, "r+")) == NULL) {
+    if((f = popen(line, "r")) == NULL) {
        perror("submake pipe");
        goterror = 1;
        unlink(tempfname);



Home | Main Index | Thread Index | Old Index