From: Vladimir 'phcoder' Serbinenko Date: Sat, 19 Oct 2013 14:14:30 +0000 (+0200) Subject: * grub-core/osdep/aros/hostdisk.c (grub_util_is_directory): X-Git-Tag: grub-2.02-beta1~637 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31de274d29d804bb71a607f7fa2ac17766c21ea7;p=thirdparty%2Fgrub.git * grub-core/osdep/aros/hostdisk.c (grub_util_is_directory): New function. (grub_util_is_special_file): Likewise. --- diff --git a/ChangeLog b/ChangeLog index a585a1310..80f9a8669 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-10-19 Vladimir Serbinenko + + * grub-core/osdep/aros/hostdisk.c (grub_util_is_directory): + New function. + (grub_util_is_special_file): Likewise. + 2013-10-19 Vladimir Serbinenko * grub-core/osdep/unix/getroot.c: Move exec functions to ... diff --git a/grub-core/osdep/aros/hostdisk.c b/grub-core/osdep/aros/hostdisk.c index c42264b9f..3fe442cf5 100644 --- a/grub-core/osdep/aros/hostdisk.c +++ b/grub-core/osdep/aros/hostdisk.c @@ -504,3 +504,24 @@ grub_util_fopen (const char *path, const char *mode) { return fopen (path, mode); } + +int +grub_util_is_directory (const char *path) +{ + struct stat st; + + if (stat (path, &st) == -1) + return 0; + + return S_ISDIR (st.st_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)); +}