From: Taylor R Campbell Date: Wed, 24 Nov 2010 18:29:14 +0000 (+0000) Subject: Handle EINTR from opendir. X-Git-Tag: 20101212-Gtk~11 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=8f6c5864562a893d7da9386a40541e7dd3831bc8;p=mit-scheme.git Handle EINTR from opendir. --- diff --git a/src/microcode/uxfs.c b/src/microcode/uxfs.c index 459adef59..902d1018e 100644 --- a/src/microcode/uxfs.c +++ b/src/microcode/uxfs.c @@ -602,9 +602,11 @@ OS_directory_valid_p (unsigned int index) unsigned int OS_directory_open (const char * name) { - DIR * pointer = (opendir (name)); - if (pointer == 0) - error_system_call (errno, syscall_opendir); + DIR * pointer; + STD_PTR_SYSTEM_CALL (syscall_opendir, pointer, (opendir (name))); + /* FIXME: This leaks a directory pointer if malloc or realloc fails + here. Avoiding this safely with a transaction is unfortunately + not straightforward. */ return (allocate_directory_pointer (pointer)); }