Module Name:    src
Committed By:   pooka
Date:           Tue Aug 12 23:47:09 UTC 2014

Modified Files:
        src/lib/librumphijack: hijack.c

Log Message:
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)


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/lib/librumphijack/hijack.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.109 src/lib/librumphijack/hijack.c:1.110
--- src/lib/librumphijack/hijack.c:1.109	Mon Jul 21 14:23:43 2014
+++ src/lib/librumphijack/hijack.c	Tue Aug 12 23:47:09 2014
@@ -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 @@ fcntl(int fd, int cmd, ...)
 		 * 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;
 

Reply via email to