mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
Remove osdep.c/qemu-img code duplication
(Kevin Wolf) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4191 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
ea86e4e600
commit
ca10f86763
20 changed files with 58 additions and 108 deletions
35
qemu-img.c
35
qemu-img.c
|
@ -30,41 +30,6 @@
|
|||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
void *get_mmap_addr(unsigned long size)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void qemu_free(void *ptr)
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
void *qemu_malloc(size_t size)
|
||||
{
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
void *qemu_mallocz(size_t size)
|
||||
{
|
||||
void *ptr;
|
||||
ptr = qemu_malloc(size);
|
||||
if (!ptr)
|
||||
return NULL;
|
||||
memset(ptr, 0, size);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
char *qemu_strdup(const char *str)
|
||||
{
|
||||
char *ptr;
|
||||
ptr = qemu_malloc(strlen(str) + 1);
|
||||
if (!ptr)
|
||||
return NULL;
|
||||
strcpy(ptr, str);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
static void __attribute__((noreturn)) error(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue