Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/xinstall munmap() so that we don't accumulate memory...



details:   https://anonhg.NetBSD.org/src/rev/b8fb3e021645
branches:  trunk
changeset: 555563:b8fb3e021645
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Nov 21 21:20:25 2003 +0000

description:
munmap() so that we don't accumulate memory on multiple files.

diffstat:

 usr.bin/xinstall/xinstall.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 57490c40a8f2 -r b8fb3e021645 usr.bin/xinstall/xinstall.c
--- a/usr.bin/xinstall/xinstall.c       Fri Nov 21 19:44:53 2003 +0000
+++ b/usr.bin/xinstall/xinstall.c       Fri Nov 21 21:20:25 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xinstall.c,v 1.80 2003/10/27 00:12:44 lukem Exp $      */
+/*     $NetBSD: xinstall.c,v 1.81 2003/11/21 21:20:25 christos Exp $   */
 
 /*
  * Copyright (c) 1987, 1993
@@ -46,7 +46,7 @@
 #if 0
 static char sccsid[] = "@(#)xinstall.c 8.1 (Berkeley) 7/21/93";
 #else
-__RCSID("$NetBSD: xinstall.c,v 1.80 2003/10/27 00:12:44 lukem Exp $");
+__RCSID("$NetBSD: xinstall.c,v 1.81 2003/11/21 21:20:25 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -733,6 +733,7 @@
                                errx(1, "%s: write: %s",
                                    to_name, strerror(serrno));
                        }
+                       (void)munmap(p, size);
                } else {
 mmap_failed:
                        while ((nr = read(from_fd, buf, sizeof(buf))) > 0) {



Home | Main Index | Thread Index | Old Index