Skip to content
Permalink
Browse files

Explicitly set stop fd

git-svn-id: https://svn.macosforge.org/repository/darwinbuild/branches/PR-8817822@930 10a61168-4876-4dac-953b-31e694342555
  • Loading branch information
wsiegrist@apple.com
wsiegrist@apple.com committed Feb 8, 2011
1 parent 5a420cd commit 593228040527fabbaab988bbf6e631039e1d20c8
Showing with 4 additions and 3 deletions.
  1. +3 −2 darwintrace/darwintrace.c
  2. +1 −1 testing/darwintrace/close-test
@@ -45,7 +45,8 @@

#define DARWINTRACE_LOG_FULL_PATH 1
#define DARWINTRACE_DEBUG_OUTPUT 0
#define DARWINTRACE_START_FD 81
#define DARWINTRACE_START_FD 101
#define DARWINTRACE_STOP_FD 200
#define DARWINTRACE_BUFFER_SIZE 1024

#if DARWINTRACE_DEBUG_OUTPUT
@@ -132,7 +133,7 @@ static inline void darwintrace_setup() {
O_CREAT | O_WRONLY | O_APPEND,
DEFFILEMODE);
int newfd;
for(newfd = DARWINTRACE_START_FD; newfd < DARWINTRACE_START_FD + 21; newfd++) {
for(newfd = DARWINTRACE_START_FD; newfd < DARWINTRACE_STOP_FD; newfd++) {
if(-1 == write(newfd, "", 0) && errno == EBADF) {
if(-1 != dup2(fd, newfd)) darwintrace_fd = newfd;
close(fd);
@@ -1,6 +1,6 @@
#!/usr/bin/env python
import os
for i in range(81,102):
for i in range(101,200):
print " ... trying to close(%s)" % i
try:
os.close(i)

0 comments on commit 5932280

Please sign in to comment.
You can’t perform that action at this time.