]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
util: Ignore return value for grub_util_mkdir() on all platforms
authorDarren Kenny <darren.kenny@oracle.com>
Tue, 9 Aug 2022 13:29:04 +0000 (13:29 +0000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Fri, 19 Aug 2022 19:38:02 +0000 (21:38 +0200)
Coverity signaled 2 issues where the return value of grub_util_mkdir()
was not being tested.

The Windows variant of this code defines the function as having no
return value (void), but the UNIX variants all are mapped using a macro
to the libc mkdir() function, which returns an int value.

To be consistent, the mapping should cast to void to for these too.

Fixes: CID 73583
Fixes: CID 73617
Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
include/grub/osdep/hostfile_aros.h
include/grub/osdep/hostfile_unix.h

index 161fbb7bdfd65ac52a4566f768691bccca22d0f9..3c67b7bc47ddce5c4fc8f3391eaaf72a47dcdd5c 100644 (file)
@@ -74,7 +74,7 @@ grub_util_readlink (const char *name, char *buf, size_t bufsize)
   return readlink(name, buf, bufsize);
 }
 
-#define grub_util_mkdir(a) mkdir ((a), 0755)
+#define grub_util_mkdir(a) (void) mkdir ((a), 0755)
 
 struct grub_util_fd
 {
index 17cd3aa8b304ce7a729c43ffcebdf31449c5f2a2..9e6d647b8d2d2fe77c7073a64c76ef1082fc91ad 100644 (file)
@@ -77,7 +77,7 @@ grub_util_readlink (const char *name, char *buf, size_t bufsize)
   return readlink(name, buf, bufsize);
 }
 
-#define grub_util_mkdir(a) mkdir ((a), 0755)
+#define grub_util_mkdir(a) (void) mkdir ((a), 0755)
 
 #if defined (__NetBSD__)
 /* NetBSD uses /boot for its boot block.  */