From b09b194fe6f2202f5f6218c79eed12c12e406aee Mon Sep 17 00:00:00 2001 From: "Taylor R. Campbell" Date: Wed, 15 Apr 2009 13:09:20 +0000 Subject: [PATCH] Fix mistake in previous commit: STD_FD_SYSTEM_CALL needs to record that we are not out of files if the system call succeeds so that the loop detection in UX_prim_check_fd_errno actually works. --- v7/src/microcode/ux.c | 9 +++++---- v7/src/microcode/ux.h | 4 +++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/v7/src/microcode/ux.c b/v7/src/microcode/ux.c index cda2d9266..8bfc06455 100644 --- a/v7/src/microcode/ux.c +++ b/v7/src/microcode/ux.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: ux.c,v 1.37 2009/04/15 13:00:19 riastradh Exp $ +$Id: ux.c,v 1.38 2009/04/15 13:09:20 riastradh Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -40,10 +40,11 @@ UX_prim_check_errno (enum syscall_names name) deliver_pending_interrupts (); } +bool UX_out_of_files_p = false; + void UX_prim_check_fd_errno (enum syscall_names name) { - static bool out_of_files_p = false; switch (errno) { case EINTR: @@ -52,9 +53,9 @@ UX_prim_check_fd_errno (enum syscall_names name) case EMFILE: case ENFILE: - if (!out_of_files_p) + if (!UX_out_of_files_p) { - out_of_files_p = true; + UX_out_of_files_p = true; REQUEST_GC (0); deliver_pending_interrupts (); } diff --git a/v7/src/microcode/ux.h b/v7/src/microcode/ux.h index afa32cb61..62d3e2064 100644 --- a/v7/src/microcode/ux.h +++ b/v7/src/microcode/ux.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: ux.h,v 1.91 2009/04/15 13:00:24 riastradh Exp $ +$Id: ux.h,v 1.92 2009/04/15 13:09:20 riastradh Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -853,6 +853,7 @@ extern int UX_sigsuspend (const sigset_t *); extern void UX_prim_check_errno (enum syscall_names name); extern void UX_prim_check_fd_errno (enum syscall_names name); +extern bool UX_out_of_files_p; #define STD_VOID_SYSTEM_CALL(name, expression) \ do { \ @@ -876,6 +877,7 @@ extern void UX_prim_check_fd_errno (enum syscall_names name); do { \ while (((result) = (expression)) < 0) \ UX_prim_check_fd_errno (name); \ + UX_out_of_files_p = false; \ } while (0) #endif /* SCM_UX_H */ -- 2.25.1