diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/sysdep.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index 47e6836d01d..ce457f63b71 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -2989,12 +2989,15 @@ char *sys_siglist[NSIG + 1] = | |||
| 2989 | 2989 | ||
| 2990 | #include <dirent.h> | 2990 | #include <dirent.h> |
| 2991 | 2991 | ||
| 2992 | #ifndef HAVE_CLOSEDIR | 2992 | #if defined(INTERRUPTIBLE_CLOSE) || !defined(HAVE_CLOSEDIR) |
| 2993 | |||
| 2993 | int | 2994 | int |
| 2994 | closedir (dirp) | 2995 | closedir (dirp) |
| 2995 | register DIR *dirp; /* stream from opendir */ | 2996 | register DIR *dirp; /* stream from opendir */ |
| 2996 | { | 2997 | { |
| 2997 | sys_close (dirp->dd_fd); | 2998 | int rtnval; |
| 2999 | |||
| 3000 | rtnval = sys_close (dirp->dd_fd); | ||
| 2998 | 3001 | ||
| 2999 | /* Some systems (like Solaris) allocate the buffer and the DIR all | 3002 | /* Some systems (like Solaris) allocate the buffer and the DIR all |
| 3000 | in one block. Why in the world are we freeing this ourselves | 3003 | in one block. Why in the world are we freeing this ourselves |
| @@ -3003,8 +3006,10 @@ closedir (dirp) | |||
| 3003 | xfree ((char *) dirp->dd_buf); /* directory block defined in <dirent.h> */ | 3006 | xfree ((char *) dirp->dd_buf); /* directory block defined in <dirent.h> */ |
| 3004 | #endif | 3007 | #endif |
| 3005 | xfree ((char *) dirp); | 3008 | xfree ((char *) dirp); |
| 3009 | |||
| 3010 | return rtnval; | ||
| 3006 | } | 3011 | } |
| 3007 | #endif /* not HAVE_CLOSEDIR */ | 3012 | #endif /* INTERRUPTIBLE_CLOSE or not HAVE_CLOSEDIR */ |
| 3008 | #endif /* SYSV_SYSTEM_DIR */ | 3013 | #endif /* SYSV_SYSTEM_DIR */ |
| 3009 | 3014 | ||
| 3010 | #ifdef NONSYSTEM_DIR_LIBRARY | 3015 | #ifdef NONSYSTEM_DIR_LIBRARY |