util: Ignore return value for grub_util_mkdir() on all platforms

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>
This commit is contained in:
Darren Kenny authored and Daniel Kiper committed 2022-08-19 21:38:02 +02:00
1 parent 0b44244025
commit d22cbe0dec
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -74,7 +74,7 @@ grub_util_readlink (const char *name, char *buf, size_t bufsize)
return readlink(name, buf, 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 struct grub_util_fd
{ {
+1 -1
View File
@@ -77,7 +77,7 @@ grub_util_readlink (const char *name, char *buf, size_t bufsize)
return readlink(name, buf, 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__) #if defined (__NetBSD__)
/* NetBSD uses /boot for its boot block. */ /* NetBSD uses /boot for its boot block. */