From bcc502cff9fea2d892a0344879e420df1d10fb47 Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Mon, 10 Nov 2014 11:22:10 -0600 Subject: Make TWRP compile for arm64 -Remove dosfstools for arm64 until we can make it compile -Fix TW_USE_TOOLBOX flag to work again -Fix symlinking and handling of sh when using mksh -Fix legacy properties to find futex_wake function -Fix libcrecovery to not use bsd_signal anymore -Fix rules for building with regards to libcrecovery -Update toolbox_recovery rules to compile tools in lollipop -Fix a few compile errors specific to arm64 Testers report that TWRP does not boot on Nexus 9 and we fail to get a shell for adb shell. At least it compiles without errors. Change-Id: I286be8628defb60cc527b8a548c0bdfcb0ebb574 --- Android.mk | 24 ++++-- bmlutils/Android.mk | 5 +- bmlutils/bmlutils.c | 45 +--------- flashutils/Android.mk | 2 +- gui/Android.mk | 2 + legacy_property_service.c | 4 +- libcrecovery/Android.mk | 6 ++ libcrecovery/system.c | 8 +- minui/graphics.c | 2 +- minuitwrp/graphics.c | 4 +- prebuilt/Android.mk | 17 ++-- toolbox/Android.mk | 206 +++++++++++++++++++++++++++------------------- twrpTar.cpp | 6 +- 13 files changed, 175 insertions(+), 156 deletions(-) diff --git a/Android.mk b/Android.mk index 13f4c849c..2b7d7db26 100644 --- a/Android.mk +++ b/Android.mk @@ -89,9 +89,9 @@ LOCAL_C_INCLUDES += bionic external/stlport/stlport LOCAL_STATIC_LIBRARIES := LOCAL_SHARED_LIBRARIES := -LOCAL_STATIC_LIBRARIES += libcrecovery libguitwrp +LOCAL_STATIC_LIBRARIES += libguitwrp LOCAL_SHARED_LIBRARIES += libz libc libstlport libcutils libstdc++ libtar libblkid libminuitwrp libminadbd libmtdutils libminzip libaosprecovery -LOCAL_SHARED_LIBRARIES += libgccdemangle +LOCAL_SHARED_LIBRARIES += libgccdemangle libcrecovery ifneq ($(wildcard system/core/libsparse/Android.mk),) LOCAL_SHARED_LIBRARIES += libsparse @@ -324,15 +324,10 @@ endif LOCAL_LDFLAGS += -Wl,-dynamic-linker,/sbin/linker LOCAL_ADDITIONAL_DEPENDENCIES := \ - busybox_symlinks \ - dosfsck \ - dosfslabel \ dump_image \ erase_image \ flash_image \ fix_permissions.sh \ - fsck_msdos_symlink \ - mkdosfs \ mke2fs.conf \ mkexfatfs \ pigz \ @@ -342,6 +337,16 @@ LOCAL_ADDITIONAL_DEPENDENCIES := \ unpigz_symlink \ updater +ifneq ($(TARGET_ARCH), arm64) + LOCAL_ADDITIONAL_DEPENDENCIES += \ + dosfsck \ + dosfslabel \ + fsck_msdos_symlink \ + mkdosfs +endif +ifneq ($(TW_USE_TOOLBOX), true) + LOCAL_ADDITIONAL_DEPENDENCIES += busybox_symlinks +endif ifeq ($(BOARD_HAS_NO_REAL_SDCARD),) LOCAL_ADDITIONAL_DEPENDENCIES += parted endif @@ -495,7 +500,6 @@ include $(commands_recovery_local_path)/injecttwrp/Android.mk \ $(commands_recovery_local_path)/mtdutils/Android.mk \ $(commands_recovery_local_path)/flashutils/Android.mk \ $(commands_recovery_local_path)/pigz/Android.mk \ - $(commands_recovery_local_path)/dosfstools/Android.mk \ $(commands_recovery_local_path)/libtar/Android.mk \ $(commands_recovery_local_path)/crypto/cryptsettings/Android.mk \ $(commands_recovery_local_path)/crypto/cryptfs/Android.mk \ @@ -508,6 +512,10 @@ include $(commands_recovery_local_path)/injecttwrp/Android.mk \ $(commands_recovery_local_path)/twrpTarMain/Android.mk \ $(commands_recovery_local_path)/mtp/Android.mk +ifneq ($(TARGET_ARCH), arm64) + include $(commands_recovery_local_path)/dosfstools/Android.mk +endif + ifeq ($(TW_INCLUDE_CRYPTO_SAMSUNG), true) include $(commands_recovery_local_path)/crypto/libcrypt_samsung/Android.mk endif diff --git a/bmlutils/Android.mk b/bmlutils/Android.mk index 7c6676b38..7216775d5 100644 --- a/bmlutils/Android.mk +++ b/bmlutils/Android.mk @@ -3,6 +3,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) BOARD_RECOVERY_DEFINES := BOARD_BML_BOOT BOARD_BML_RECOVERY +LOCAL_STATIC_LIBRARY := libcrecovery $(foreach board_define,$(BOARD_RECOVERY_DEFINES), \ $(if $($(board_define)), \ @@ -10,9 +11,6 @@ $(foreach board_define,$(BOARD_RECOVERY_DEFINES), \ ) \ ) -LOCAL_STATIC_LIBRARIES := libcrecovery -LOCAL_C_INCLUDES := $(commands_recovery_local_path)/libcrecovery - LOCAL_SRC_FILES := bmlutils.c LOCAL_MODULE := libbmlutils LOCAL_MODULE_TAGS := eng @@ -22,6 +20,7 @@ include $(BUILD_STATIC_LIBRARY) include $(CLEAR_VARS) BOARD_RECOVERY_DEFINES := BOARD_BML_BOOT BOARD_BML_RECOVERY +LOCAL_SHARED_LIBRARIES := libcrecovery $(foreach board_define,$(BOARD_RECOVERY_DEFINES), \ $(if $($(board_define)), \ diff --git a/bmlutils/bmlutils.c b/bmlutils/bmlutils.c index d59475eba..4c7c49d03 100644 --- a/bmlutils/bmlutils.c +++ b/bmlutils/bmlutils.c @@ -22,50 +22,7 @@ #include -#undef _PATH_BSHELL -#define _PATH_BSHELL "/sbin/sh" - -int __system(const char *command) -{ - pid_t pid; - sig_t intsave, quitsave; - sigset_t mask, omask; - int pstat; - char *argp[] = {"sh", "-c", NULL, NULL}; - - if (!command) /* just checking... */ - return(1); - - argp[2] = (char *)command; - - sigemptyset(&mask); - sigaddset(&mask, SIGCHLD); - sigprocmask(SIG_BLOCK, &mask, &omask); - switch (pid = vfork()) { - case -1: /* error */ - sigprocmask(SIG_SETMASK, &omask, NULL); - return(-1); - case 0: /* child */ - sigprocmask(SIG_SETMASK, &omask, NULL); - execve(_PATH_BSHELL, argp, environ); - _exit(127); - } - - intsave = (sig_t) bsd_signal(SIGINT, SIG_IGN); - quitsave = (sig_t) bsd_signal(SIGQUIT, SIG_IGN); - pid = waitpid(pid, (int *)&pstat, 0); - sigprocmask(SIG_SETMASK, &omask, NULL); - (void)bsd_signal(SIGINT, intsave); - (void)bsd_signal(SIGQUIT, quitsave); - return (pid == -1 ? -1 : pstat); -} - -static struct pid { - struct pid *next; - FILE *fp; - pid_t pid; -} *pidlist; - +#include "../libcrecovery/common.h" static int restore_internal(const char* bml, const char* filename) { diff --git a/flashutils/Android.mk b/flashutils/Android.mk index 3209cb0c5..a697a0998 100644 --- a/flashutils/Android.mk +++ b/flashutils/Android.mk @@ -83,7 +83,7 @@ LOCAL_SRC_FILES := flashutils.c LOCAL_MODULE := libflashutils LOCAL_MODULE_TAGS := eng LOCAL_C_INCLUDES += $(commands_recovery_local_path) -LOCAL_SHARED_LIBRARIES := libc libmmcutils libbmlutils +LOCAL_SHARED_LIBRARIES := libc libmmcutils libbmlutils libcrecovery LOCAL_STATIC_LIBRARIES := libmtdutils BOARD_RECOVERY_DEFINES := BOARD_BML_BOOT BOARD_BML_RECOVERY diff --git a/gui/Android.mk b/gui/Android.mk index 9cc043170..479bc76f9 100644 --- a/gui/Android.mk +++ b/gui/Android.mk @@ -130,7 +130,9 @@ $(TWRP_RES_GEN): $(TWRP_COMMON_XML) $(TWRP_REMOVE_FONT) mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/sbin/ +ifneq ($(TW_USE_TOOLBOX), true) ln -sf $(TWRP_SH_TARGET) $(TARGET_RECOVERY_ROOT_OUT)/sbin/sh +endif ln -sf /sbin/pigz $(TARGET_RECOVERY_ROOT_OUT)/sbin/gzip ln -sf /sbin/unpigz $(TARGET_RECOVERY_ROOT_OUT)/sbin/gunzip diff --git a/legacy_property_service.c b/legacy_property_service.c index 24d3aa920..490a24524 100644 --- a/legacy_property_service.c +++ b/legacy_property_service.c @@ -25,6 +25,8 @@ #include #include +#include "../../bionic/libc/private/bionic_futex.h" + #include #include "legacy_properties.h" @@ -181,7 +183,7 @@ static int legacy_property_set(const char *name, const char *value) memcpy(pi->value, value, valuelen + 1); pa->toc[pa->count] = - (namelen << 24) | (((unsigned) pi) - ((unsigned) pa)); + (namelen << 24) | (((unsigned long) pi) - ((unsigned long) pa)); pa->count++; pa->serial++; diff --git a/libcrecovery/Android.mk b/libcrecovery/Android.mk index d948dd100..8434d519d 100644 --- a/libcrecovery/Android.mk +++ b/libcrecovery/Android.mk @@ -8,4 +8,10 @@ LOCAL_MODULE := libcrecovery LOCAL_MODULE_TAGS := eng include $(BUILD_STATIC_LIBRARY) +include $(CLEAR_VARS) +LOCAL_SRC_FILES := system.c popen.c +LOCAL_MODULE := libcrecovery +LOCAL_MODULE_TAGS := eng +include $(BUILD_SHARED_LIBRARY) + endif diff --git a/libcrecovery/system.c b/libcrecovery/system.c index 6d78ae946..c5dd550fe 100644 --- a/libcrecovery/system.c +++ b/libcrecovery/system.c @@ -66,11 +66,11 @@ __system(const char *command) _exit(127); } - intsave = (sig_t) bsd_signal(SIGINT, SIG_IGN); - quitsave = (sig_t) bsd_signal(SIGQUIT, SIG_IGN); + intsave = (sig_t) signal(SIGINT, SIG_IGN); + quitsave = (sig_t) signal(SIGQUIT, SIG_IGN); pid = waitpid(pid, (int *)&pstat, 0); sigprocmask(SIG_SETMASK, &omask, NULL); - (void)bsd_signal(SIGINT, intsave); - (void)bsd_signal(SIGQUIT, quitsave); + (void)signal(SIGINT, intsave); + (void)signal(SIGQUIT, quitsave); return (pid == -1 ? -1 : pstat); } diff --git a/minui/graphics.c b/minui/graphics.c index 948a07c0f..3713f61de 100644 --- a/minui/graphics.c +++ b/minui/graphics.c @@ -175,7 +175,7 @@ static int get_framebuffer(GGLSurface *fb) fb->stride = fi.line_length/PIXEL_SIZE; fb->format = PIXEL_FORMAT; if (!has_overlay) { - fb->data = (void*) (((unsigned) bits) + vi.yres * fi.line_length); + fb->data = (void*) (((unsigned long) bits) + vi.yres * fi.line_length); memset(fb->data, 0, vi.yres * fi.line_length); } diff --git a/minuitwrp/graphics.c b/minuitwrp/graphics.c index 9926904ef..d08e74303 100644 --- a/minuitwrp/graphics.c +++ b/minuitwrp/graphics.c @@ -300,10 +300,10 @@ static int get_framebuffer(GGLSurface *fb) fb->height = vi.yres; #ifdef BOARD_HAS_JANKY_BACKBUFFER fb->stride = fi.line_length/2; - fb->data = (void*) (((unsigned) bits) + vi.yres * fi.line_length); + fb->data = (GGLubyte*) (((unsigned long) bits) + vi.yres * fi.line_length); #else fb->stride = vi.xres_virtual; - fb->data = (void*) (((unsigned) bits) + vi.yres * fb->stride * PIXEL_SIZE); + fb->data = (GGLubyte*) (((unsigned long) bits) + vi.yres * fb->stride * PIXEL_SIZE); #endif fb->format = PIXEL_FORMAT; if (!has_overlay) { diff --git a/prebuilt/Android.mk b/prebuilt/Android.mk index 80c7fa4f2..ddfe99fdc 100644 --- a/prebuilt/Android.mk +++ b/prebuilt/Android.mk @@ -16,12 +16,16 @@ RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/erase_image ifneq ($(TW_USE_TOOLBOX), true) RELINK_SOURCE_FILES += $(TARGET_OUT_OPTIONAL_EXECUTABLES)/busybox else - RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/mksh + RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/sh + RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcrypto.so endif RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/pigz -RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/dosfsck -RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/dosfslabel -RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/mkdosfs +# dosfstools does not build for arm64 right now +ifneq ($(TARGET_ARCH), arm64) + RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/dosfsck + RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/dosfslabel + RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/mkdosfs +endif RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/e2fsck RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/mke2fs RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/tune2fs @@ -31,6 +35,7 @@ RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libc.so RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcutils.so # Not available in 5.0 #RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcorkscrew.so +RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcrecovery.so RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libusbhost.so RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libgccdemangle.so RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libutils.so @@ -123,9 +128,9 @@ ifneq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS), true) RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libopenaes.so endif ifeq ($(TARGET_USERIMAGES_USE_F2FS), true) - RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/mkfs.f2fs + RELINK_SOURCE_FILES += $(TARGET_ROOT_OUT_SBIN)/mkfs.f2fs RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/fsck.f2fs - RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/fibmap.f2fs + #RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/fibmap.f2fs endif ifneq ($(wildcard system/core/reboot/Android.mk),) RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/reboot diff --git a/toolbox/Android.mk b/toolbox/Android.mk index 8a96c81ef..ad2e24c5c 100644 --- a/toolbox/Android.mk +++ b/toolbox/Android.mk @@ -1,7 +1,15 @@ LOCAL_PATH:= system/core/toolbox/ + + +common_cflags := \ + -std=gnu99 \ + -Werror -Wno-unused-parameter \ + -I$(LOCAL_PATH)/upstream-netbsd/include/ \ + -include bsd-compatibility.h + include $(CLEAR_VARS) -TOOLS := \ +OUR_TOOLS := \ start \ stop \ getprop \ @@ -20,103 +28,130 @@ ifeq ($(TWHAVE_SELINUX), true) getsebool \ setsebool \ load_policy - TOOLS += $(filter-out $(RECOVERY_BUSYBOX_TOOLS), $(TOOLS_FOR_SELINUX)) + OUR_TOOLS += $(filter-out $(RECOVERY_BUSYBOX_TOOLS), $(TOOLS_FOR_SELINUX)) endif + ifeq ($(TW_USE_TOOLBOX), true) - TOOLS += \ - mount \ - cat \ - ps \ - kill \ - ln \ - insmod \ - rmmod \ - lsmod \ - ifconfig \ - setconsole \ - rm \ - mkdir \ - rmdir \ - getevent \ - sendevent \ - date \ - wipe \ - sync \ - umount \ - notify \ - cmp \ - dmesg \ - route \ - hd \ - dd \ - df \ - watchprops \ - log \ - sleep \ - renice \ - printenv \ - smd \ - chmod \ - chown \ - newfs_msdos \ - netstat \ - ioctl \ - mv \ - schedtop \ - top \ - iftop \ - id \ - uptime \ - vmstat \ - nandread \ - ionice \ - touch \ - lsof \ - du \ - md5 \ - clear \ - swapon \ - swapoff \ - mkswap \ - readlink - ifneq ($(TWHAVE_SELINUX), true) - TOOLS += ls - endif +BSD_TOOLS := \ + cat \ + chown \ + cp \ + dd \ + du \ + grep \ + kill \ + ln \ + mv \ + printenv \ + rm \ + rmdir \ + sleep \ + sync \ + +OUR_TOOLS += \ + chmod \ + clear \ + cmp \ + date \ + df \ + dmesg \ + getevent \ + hd \ + id \ + ifconfig \ + iftop \ + insmod \ + ioctl \ + ionice \ + log \ + lsmod \ + lsof \ + md5 \ + mkdir \ + mknod \ + mkswap \ + mount \ + nandread \ + netstat \ + newfs_msdos \ + nohup \ + notify \ + ps \ + readlink \ + renice \ + rmmod \ + route \ + schedtop \ + sendevent \ + smd \ + swapoff \ + swapon \ + top \ + touch \ + umount \ + uptime \ + vmstat \ + watchprops \ + wipe + ifneq ($(TWHAVE_SELINUX), true) + TOOLS += ls + endif + LOCAL_SHARED_LIBRARIES += libcrypto endif -LOCAL_SRC_FILES := \ - toolbox.c \ - $(patsubst %,%.c,$(TOOLS)) - -ifneq ($(wildcard system/core/toolbox/dynarray.c),) - LOCAL_SRC_FILES += dynarray.c +ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) +OUR_TOOLS += r endif -# reboot.c was removed in 4.4 kitkat -#TOOLS += reboot +ALL_TOOLS = $(BSD_TOOLS) $(OUR_TOOLS) -#ifeq ($(BOARD_USES_BOOTMENU),true) -# LOCAL_SRC_FILES += ../../../external/bootmenu/libreboot/reboot.c -#else -# LOCAL_SRC_FILES += reboot.c -#endif +LOCAL_SRC_FILES := \ + upstream-netbsd/lib/libc/gen/getbsize.c \ + upstream-netbsd/lib/libc/gen/humanize_number.c \ + upstream-netbsd/lib/libc/stdlib/strsuftoll.c \ + upstream-netbsd/lib/libc/string/swab.c \ + upstream-netbsd/lib/libutil/raise_default_signal.c \ + dynarray.c \ + pwcache.c \ + $(patsubst %,%.c,$(OUR_TOOLS)) \ + toolbox.c \ + +LOCAL_CFLAGS += $(common_cflags) -LOCAL_C_INCLUDES := bionic/libc/bionic +LOCAL_C_INCLUDES += external/openssl/include -LOCAL_SHARED_LIBRARIES := \ - libcutils \ - liblog \ - libc +LOCAL_SHARED_LIBRARIES += libcutils ifeq ($(TWHAVE_SELINUX), true) - LOCAL_SHARED_LIBRARIES += libselinux + LOCAL_SHARED_LIBRARIES += libselinux + LOCAL_STATIC_LIBRARIES += \ + libtoolbox_cat \ + libtoolbox_chown \ + libtoolbox_cp \ + libtoolbox_dd \ + libtoolbox_grep \ + libtoolbox_kill \ + libtoolbox_ln \ + libtoolbox_mv \ + libtoolbox_printenv \ + libtoolbox_rm \ + libtoolbox_rmdir \ + libtoolbox_sleep \ + libtoolbox_sync endif +# libusbhost is only used by lsusb, and that isn't usually included in toolbox. +# The linker strips out all the unused library code in the normal case. +LOCAL_STATIC_LIBRARIES := \ + libusbhost \ + +LOCAL_WHOLE_STATIC_LIBRARIES := $(patsubst %,libtoolbox_%,$(BSD_TOOLS)) + LOCAL_MODULE := toolbox_recovery LOCAL_MODULE_STEM := toolbox LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin -LOCAL_MODULE_TAGS := optional +LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk # Including this will define $(intermediates). # @@ -125,7 +160,7 @@ include $(BUILD_EXECUTABLE) $(LOCAL_PATH)/toolbox.c: $(intermediates)/tools.h TOOLS_H := $(intermediates)/tools.h -$(TOOLS_H): PRIVATE_TOOLS := $(TOOLS) +$(TOOLS_H): PRIVATE_TOOLS := $(ALL_TOOLS) $(TOOLS_H): PRIVATE_CUSTOM_TOOL = echo "/* file generated automatically */" > $@ ; for t in $(PRIVATE_TOOLS) ; do echo "TOOL($$t)" >> $@ ; done $(TOOLS_H): $(LOCAL_PATH)/Android.mk $(TOOLS_H): @@ -133,7 +168,7 @@ $(TOOLS_H): # Make #!/system/bin/toolbox launchers for each tool. # -SYMLINKS := $(addprefix $(TARGET_RECOVERY_ROOT_OUT)/sbin/,$(TOOLS)) +SYMLINKS := $(addprefix $(TARGET_RECOVERY_ROOT_OUT)/sbin/,$(ALL_TOOLS)) $(SYMLINKS): TOOLBOX_BINARY := $(LOCAL_MODULE_STEM) $(SYMLINKS): $(LOCAL_INSTALLED_MODULE) $(LOCAL_PATH)/Android.mk @echo "Symlink: $@ -> $(TOOLBOX_BINARY)" @@ -147,3 +182,8 @@ LOCAL_MODULE_TAGS := optional LOCAL_ADDITIONAL_DEPENDENCIES := $(SYMLINKS) include $(BUILD_PHONY_PACKAGE) SYMLINKS := + +# We need this so that the installed files could be picked up based on the +# local module name +ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \ + $(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(SYMLINKS) diff --git a/twrpTar.cpp b/twrpTar.cpp index 28ac91ac1..b5d66d31b 100644 --- a/twrpTar.cpp +++ b/twrpTar.cpp @@ -300,7 +300,7 @@ int twrpTar::createTarFork(const unsigned long long *overall_size, const unsigne _exit(-1); } else { LOGINFO("Joined thread %i.\n", i); - ret = (int)thread_return; + ret = *((int *)thread_return); if (ret != 0) { thread_error = 1; LOGERR("Thread %i returned an error %i.\n", i, ret); @@ -532,7 +532,7 @@ int twrpTar::extractTarFork(const unsigned long long *overall_size, unsigned lon _exit(-1); } else { LOGINFO("Joined thread %i.\n", i); - ret = (int)thread_return; + ret = *((int *)thread_return); if (ret != 0) { thread_error = 1; LOGERR("Thread %i returned an error %i.\n", i, ret); @@ -751,7 +751,7 @@ int twrpTar::tarList(std::vector *TarList, unsigned thread_id) { LOGERR("Error closing '%s' on thread %i\n", tarfn.c_str(), thread_id); return -3; } - LOGINFO("Thread id %i tarList done, %i archives.\n", thread_id, archive_count, i, list_size); + LOGINFO("Thread id %i tarList done, %i archives.\n", thread_id, archive_count); return 0; } -- cgit v1.2.3