From 8fece58747bd351fad8cf8470e4e0d1c9c46e8e2 Mon Sep 17 00:00:00 2001 From: corinna Date: Mon, 10 Oct 2011 18:59:55 +0000 Subject: [PATCH] * fhandler.h (fhandler_process::closedir): Declare. * fhandler_process.cc (fhandler_process::closedir): New function to avoid a SEGV in fhandler_proc::closedir. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/fhandler.h | 1 + winsup/cygwin/fhandler_process.cc | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index c47b9e4927..0abec830e2 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2011-10-10 Corinna Vinschen + + * fhandler.h (fhandler_process::closedir): Declare. + * fhandler_process.cc (fhandler_process::closedir): New function to + avoid a SEGV in fhandler_proc::closedir. + 2011-10-10 Christopher Faylor * fhandler_tty.cc (fhandler_pty_slave::open): Clarify debugging output. diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index be6e012b0d..cc391ae786 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -1531,6 +1531,7 @@ class fhandler_process: public fhandler_proc fhandler_process (); virtual_ftype_t exists(); DIR *opendir (int fd) __attribute__ ((regparm (2))); + int closedir (DIR *); int readdir (DIR *, dirent *) __attribute__ ((regparm (3))); int open (int flags, mode_t mode = 0); int __stdcall fstat (struct __stat64 *buf) __attribute__ ((regparm (2))); diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc index 91e2286d05..128b35aa40 100644 --- a/winsup/cygwin/fhandler_process.cc +++ b/winsup/cygwin/fhandler_process.cc @@ -210,6 +210,12 @@ fhandler_process::opendir (int fd) } int +fhandler_process::closedir (DIR *dir) +{ + return fhandler_virtual::closedir (dir); +} + +int fhandler_process::readdir (DIR *dir, dirent *de) { int res = ENMFILE; -- 2.11.0