Use unix functions for temporary files and special files on cygwin.
This commit is contained in:
parent
37378f748a
commit
4f979ccbf1
3 changed files with 12 additions and 10 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2013-12-16 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
Use unix functions for temporary files and special files on cygwin.
|
||||||
|
|
||||||
2013-12-16 Vladimir Serbinenko <phcoder@gmail.com>
|
2013-12-16 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
Define functions explicitly rather than using --defsym in tests
|
Define functions explicitly rather than using --defsym in tests
|
||||||
|
|
|
@ -275,6 +275,10 @@ grub_util_get_mtime (const char *path)
|
||||||
return st.st_mtime;
|
return st.st_mtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined (__CYGWIN__) || (!defined (__MINGW32__) && !defined (__AROS__))
|
||||||
|
|
||||||
int
|
int
|
||||||
grub_util_is_special_file (const char *path)
|
grub_util_is_special_file (const char *path)
|
||||||
{
|
{
|
||||||
|
|
|
@ -467,6 +467,8 @@ grub_util_rmdir (const char *name)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __CYGWIN__
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
get_temp_name (void)
|
get_temp_name (void)
|
||||||
{
|
{
|
||||||
|
@ -536,6 +538,8 @@ grub_util_make_temporary_dir (void)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
grub_util_is_directory (const char *name)
|
grub_util_is_directory (const char *name)
|
||||||
{
|
{
|
||||||
|
@ -661,14 +665,4 @@ grub_util_fopen (const char *path, const char *mode)
|
||||||
return fopen (path, 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
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue