summaryrefslogtreecommitdiff
path: root/drivers/unix
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/unix')
-rw-r--r--drivers/unix/ip_unix.cpp2
-rw-r--r--drivers/unix/memory_pool_static_malloc.cpp8
-rw-r--r--drivers/unix/os_unix.cpp6
3 files changed, 10 insertions, 6 deletions
diff --git a/drivers/unix/ip_unix.cpp b/drivers/unix/ip_unix.cpp
index c221743457..841160f941 100644
--- a/drivers/unix/ip_unix.cpp
+++ b/drivers/unix/ip_unix.cpp
@@ -28,7 +28,7 @@
/*************************************************************************/
#include "ip_unix.h"
-#if defined(UNIX_ENABLED) || defined(WINDOWS_ENABLED)
+#if defined(UNIX_ENABLED) || defined(WINDOWS_ENABLED) && !defined(WINRT_ENABLED)
#ifdef WINDOWS_ENABLED
diff --git a/drivers/unix/memory_pool_static_malloc.cpp b/drivers/unix/memory_pool_static_malloc.cpp
index fa1266b2df..4711f4f090 100644
--- a/drivers/unix/memory_pool_static_malloc.cpp
+++ b/drivers/unix/memory_pool_static_malloc.cpp
@@ -40,10 +40,9 @@
* so BE CAREFUL!
*/
-
void* MemoryPoolStaticMalloc::alloc(size_t p_bytes,const char *p_description) {
- #if DFAULT_ALIGNMENT == 1
+ #if DEFAULT_ALIGNMENT == 1
return _alloc(p_bytes, p_description);
@@ -123,7 +122,7 @@ void* MemoryPoolStaticMalloc::_alloc(size_t p_bytes,const char *p_description) {
void* MemoryPoolStaticMalloc::realloc(void *p_memory,size_t p_bytes) {
- #if DFAULT_ALIGNMENT == 1
+ #if DEFAULT_ALIGNMENT == 1
return _realloc(p_memory,p_bytes);
#else
@@ -172,7 +171,6 @@ void* MemoryPoolStaticMalloc::_realloc(void *p_memory,size_t p_bytes) {
bool single_element = (ringptr->next == ringptr) && (ringptr->prev == ringptr);
bool is_list = ( ringlist == ringptr );
-
RingPtr *new_ringptr=(RingPtr*)::realloc(ringptr, p_bytes+sizeof(RingPtr));
ERR_FAIL_COND_V( new_ringptr == 0, NULL ); /// reallocation failed
@@ -213,7 +211,7 @@ void MemoryPoolStaticMalloc::free(void *p_ptr) {
ERR_FAIL_COND( !MemoryPoolStatic::get_singleton());
- #if DFAULT_ALIGNMENT == 1
+ #if DEFAULT_ALIGNMENT == 1
_free(p_ptr);
#else
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp
index e6458068ea..2de975e5d1 100644
--- a/drivers/unix/os_unix.cpp
+++ b/drivers/unix/os_unix.cpp
@@ -332,6 +332,12 @@ Error OS_Unix::execute(const String& p_path, const List<String>& p_arguments,boo
Error OS_Unix::kill(const ProcessID& p_pid) {
int ret = ::kill(p_pid,SIGKILL);
+ if (!ret) {
+ //avoid zombie process
+ int st;
+ ::waitpid(p_pid,&st,0);
+
+ }
return ret?ERR_INVALID_PARAMETER:OK;
}