aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/os-Linux/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/os-Linux/main.c')
-rw-r--r--arch/um/os-Linux/main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c
index 7aa4c2a7a593..2c089c2c63bf 100644
--- a/arch/um/os-Linux/main.c
+++ b/arch/um/os-Linux/main.c
@@ -218,7 +218,7 @@ int main(int argc, char **argv, char **envp)
218 ret = 1; 218 ret = 1;
219 } 219 }
220 printf("\n"); 220 printf("\n");
221 return(uml_exitcode); 221 return uml_exitcode;
222} 222}
223 223
224#define CAN_KMALLOC() \ 224#define CAN_KMALLOC() \
@@ -231,7 +231,7 @@ void *__wrap_malloc(int size)
231 void *ret; 231 void *ret;
232 232
233 if(!CAN_KMALLOC()) 233 if(!CAN_KMALLOC())
234 return(__real_malloc(size)); 234 return __real_malloc(size);
235 else if(size <= PAGE_SIZE) /* finding contiguos pages can be hard*/ 235 else if(size <= PAGE_SIZE) /* finding contiguos pages can be hard*/
236 ret = um_kmalloc(size); 236 ret = um_kmalloc(size);
237 else ret = um_vmalloc(size); 237 else ret = um_vmalloc(size);
@@ -242,16 +242,17 @@ void *__wrap_malloc(int size)
242 if(ret == NULL) 242 if(ret == NULL)
243 errno = ENOMEM; 243 errno = ENOMEM;
244 244
245 return(ret); 245 return ret;
246} 246}
247 247
248void *__wrap_calloc(int n, int size) 248void *__wrap_calloc(int n, int size)
249{ 249{
250 void *ptr = __wrap_malloc(n * size); 250 void *ptr = __wrap_malloc(n * size);
251 251
252 if(ptr == NULL) return(NULL); 252 if(ptr == NULL)
253 return NULL;
253 memset(ptr, 0, n * size); 254 memset(ptr, 0, n * size);
254 return(ptr); 255 return ptr;
255} 256}
256 257
257extern void __real_free(void *); 258extern void __real_free(void *);