Skip to content

Commit

Permalink
util: Make qemu_oom_check() a static function
Browse files Browse the repository at this point in the history
The qemu_oom_check() function, which we define in both oslib-posix.c
and oslib-win32.c, is now used only locally in that file; make it
static.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20220226180723.1706285-3-peter.maydell@linaro.org
  • Loading branch information
pm215 committed Mar 7, 2022
1 parent 9d662a6 commit 1c6c3b7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions include/qemu-common.h
Expand Up @@ -26,8 +26,6 @@
int qemu_main(int argc, char **argv, char **envp);
#endif

void *qemu_oom_check(void *ptr);

ssize_t qemu_write_full(int fd, const void *buf, size_t count)
QEMU_WARN_UNUSED_RESULT;

Expand Down
2 changes: 1 addition & 1 deletion util/oslib-posix.c
Expand Up @@ -199,7 +199,7 @@ bool qemu_write_pidfile(const char *path, Error **errp)
return false;
}

void *qemu_oom_check(void *ptr)
static void *qemu_oom_check(void *ptr)
{
if (ptr == NULL) {
fprintf(stderr, "Failed to allocate memory: %s\n", strerror(errno));
Expand Down
2 changes: 1 addition & 1 deletion util/oslib-win32.c
Expand Up @@ -44,7 +44,7 @@
/* this must come after including "trace.h" */
#include <shlobj.h>

void *qemu_oom_check(void *ptr)
static void *qemu_oom_check(void *ptr)
{
if (ptr == NULL) {
fprintf(stderr, "Failed to allocate memory: %lu\n", GetLastError());
Expand Down

0 comments on commit 1c6c3b7

Please sign in to comment.