]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/osdep/aros/hostdisk.c (grub_util_is_directory):
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 19 Oct 2013 14:14:30 +0000 (16:14 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 19 Oct 2013 14:14:30 +0000 (16:14 +0200)
New function.
(grub_util_is_special_file): Likewise.

ChangeLog
grub-core/osdep/aros/hostdisk.c

index a585a131073c3503110b85e598e65ba39948fa66..80f9a8669f60b7b03b1d53508a3b83d35c2df848 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-10-19  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/osdep/aros/hostdisk.c (grub_util_is_directory):
+       New function.
+       (grub_util_is_special_file): Likewise.
+
 2013-10-19  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/osdep/unix/getroot.c: Move exec functions to ...
index c42264b9f703bac7c40bb8eb0d3e832400aaeea6..3fe442cf59f504f80f4a6e4fea52177804d8e1ec 100644 (file)
@@ -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));
+}