From 4f979ccbf13b755ff8988cc9695c7bb7eb9ebb5a Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 16 Dec 2013 13:16:37 +0100 Subject: [PATCH] Use unix functions for temporary files and special files on cygwin. --- ChangeLog | 4 ++++ grub-core/osdep/unix/hostdisk.c | 4 ++++ grub-core/osdep/windows/hostdisk.c | 14 ++++---------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index ac59e97d0..5824c165f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-12-16 Vladimir Serbinenko + + Use unix functions for temporary files and special files on cygwin. + 2013-12-16 Vladimir Serbinenko Define functions explicitly rather than using --defsym in tests diff --git a/grub-core/osdep/unix/hostdisk.c b/grub-core/osdep/unix/hostdisk.c index 309562af4..fa83f26e2 100644 --- a/grub-core/osdep/unix/hostdisk.c +++ b/grub-core/osdep/unix/hostdisk.c @@ -275,6 +275,10 @@ grub_util_get_mtime (const char *path) return st.st_mtime; } +#endif + +#if defined (__CYGWIN__) || (!defined (__MINGW32__) && !defined (__AROS__)) + int grub_util_is_special_file (const char *path) { diff --git a/grub-core/osdep/windows/hostdisk.c b/grub-core/osdep/windows/hostdisk.c index 8f56c21b0..af7d07ca7 100644 --- a/grub-core/osdep/windows/hostdisk.c +++ b/grub-core/osdep/windows/hostdisk.c @@ -467,6 +467,8 @@ grub_util_rmdir (const char *name) return ret; } +#ifndef __CYGWIN__ + static char * get_temp_name (void) { @@ -536,6 +538,8 @@ grub_util_make_temporary_dir (void) return ret; } +#endif + int grub_util_is_directory (const char *name) { @@ -661,14 +665,4 @@ grub_util_fopen (const char *path, const char *mode) return fopen (path, mode); } -int -grub_util_is_special_file (const char *path) -{ - struct stat st; - - if (lstat (path, &st) == -1) - return 1; - return (!S_ISREG (st.st_mode) && !S_ISDIR (st.st_mode)); -} - #endif