Source-Changes-HG archive

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

[src/trunk]: src/lib/librumphijack In case of no dup2'd fd's, make sure that ...



details:   https://anonhg.NetBSD.org/src/rev/20af79a8a0f6
branches:  trunk
changeset: 801649:20af79a8a0f6
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue Aug 12 23:47:09 2014 +0000

description:
In case of no dup2'd fd's, make sure that F_CLOSEM for the
rump kernel starts from 0.

Fixes rumphijack fdoff test (notably, this bug had nothing to do with
fdoff, and was exposed >3 years after writing the test when rump kernels
started providing fd's 0/1/2)

diffstat:

 lib/librumphijack/hijack.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 507b04a80d03 -r 20af79a8a0f6 lib/librumphijack/hijack.c
--- a/lib/librumphijack/hijack.c        Tue Aug 12 20:57:59 2014 +0000
+++ b/lib/librumphijack/hijack.c        Tue Aug 12 23:47:09 2014 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: hijack.c,v 1.109 2014/07/21 14:23:43 gson Exp $       */
+/*      $NetBSD: hijack.c,v 1.110 2014/08/12 23:47:09 pooka Exp $      */
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
 #include <rump/rumpuser_port.h>
 
 #if !defined(lint)
-__RCSID("$NetBSD: hijack.c,v 1.109 2014/07/21 14:23:43 gson Exp $");
+__RCSID("$NetBSD: hijack.c,v 1.110 2014/08/12 23:47:09 pooka Exp $");
 #endif
 
 #include <sys/param.h>
@@ -1380,7 +1380,7 @@
                 * for the file descriptors not dup2'd.
                 */
 
-               for (i = 0, maxdup2 = 0; i <= DUP2HIGH; i++) {
+               for (i = 0, maxdup2 = -1; i <= DUP2HIGH; i++) {
                        if (dup2vec[i] & DUP2BIT) {
                                int val;
 



Home | Main Index | Thread Index | Old Index