retain 'errno' on the final unlink()
[util-vserver.git] / util-vserver / lib_internal / util-mem.h
index 6ed98a0..4427a14 100644 (file)
 #define H_UTIL_VSERVER_LIB_INTERNAL_UTIL_MEM_H
 
 #include <string.h>
+#include <stdlib.h>
 
 inline static void *
 Xmemcpy(void * restrict dst, void const * restrict src, size_t len)
 {
-  memcpy(dst, src, len);
-  return (char *)(dst)+len;
+  return (char *)(memcpy(dst, src, len))+len;
 }
 
 #endif //  H_UTIL_VSERVER_LIB_INTERNAL_UTIL_MEM_H