From 8f6c5864562a893d7da9386a40541e7dd3831bc8 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Wed, 24 Nov 2010 18:29:14 +0000 Subject: [PATCH] Handle EINTR from opendir. --- src/microcode/uxfs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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)); } -- 2.25.1