Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/xlint/xlint Apply fix from PR bin/8328 by Anders Hja...



details:   https://anonhg.NetBSD.org/src/rev/ae6c1d77f1aa
branches:  trunk
changeset: 476100:ae6c1d77f1aa
user:      jwise <jwise%NetBSD.org@localhost>
date:      Mon Sep 06 06:45:20 1999 +0000

description:
Apply fix from PR bin/8328 by Anders Hjalmarsson (Anders.Hjalmarsson%economics.gu.se@localhost):

work properly again when passwd multiple files on the command line.

diffstat:

 usr.bin/xlint/xlint/xlint.c |  15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diffs (43 lines):

diff -r 958ffc944c5e -r ae6c1d77f1aa usr.bin/xlint/xlint/xlint.c
--- a/usr.bin/xlint/xlint/xlint.c       Mon Sep 06 06:23:08 1999 +0000
+++ b/usr.bin/xlint/xlint/xlint.c       Mon Sep 06 06:45:20 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xlint.c,v 1.13 1999/05/03 15:45:01 christos Exp $      */
+/*     $NetBSD: xlint.c,v 1.14 1999/09/06 06:45:20 jwise Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -34,7 +34,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: xlint.c,v 1.13 1999/05/03 15:45:01 christos Exp $");
+__RCSID("$NetBSD: xlint.c,v 1.14 1999/09/06 06:45:20 jwise Exp $");
 #endif
 
 #include <sys/param.h>
@@ -541,6 +541,15 @@
        int is_stdin;
        int     fd;
 
+       if (lseek(cppoutfd, SEEK_SET, (off_t)0) != 0) {
+               warn("lseek");
+               terminate(-1);
+       }
+       if (ftruncate(cppoutfd, (off_t)0) != 0) {
+               warn("ftruncate");
+               terminate(-1);
+       }
+       
        is_stdin = (strcmp(name, "-") == 0);
        bn = basename(name, '/');
        suff = basename(bn, '.');
@@ -604,8 +613,6 @@
        runchild(path, args, cppout, cppoutfd);
        free(path);
        freelst(&args);
-       if (cppoutfd != -1)
-               (void)close(cppoutfd);
 
        /* run lint1 */
 



Home | Main Index | Thread Index | Old Index