diff --git a/Makefile b/Makefile index b7bf9b7..f77b959 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ STRIP = strip CC ?= cc CFLAGS += -I$(DEP)/include -I$(SRC)/include -I$(SRC) CFLAGS += -Wall -Wextra -DPALERAIN_VERSION=\"2.0.0\" -Wall -Wextra -Wno-unused-parameter -CFLAGS += -Wno-unused-variable -I$(SRC)/src -std=c99 -pedantic-errors -D_DARWIN_C_SOURCE -D_GNU_SOURCE +CFLAGS += -Wno-unused-variable -I$(SRC)/src -std=c99 -pedantic-errors -D_C99_SOURCE -D_POSIX_C_SOURCE=199506L LIBS += $(DEP)/lib/libimobiledevice-1.0.a $(DEP)/lib/libirecovery-1.0.a $(DEP)/lib/libusbmuxd-2.0.a LIBS += $(DEP)/lib/libimobiledevice-glue-1.0.a $(DEP)/lib/libplist-2.0.a -pthread ifeq ($(TARGET_OS),) diff --git a/src/dfuhelper.c b/src/dfuhelper.c index 22c0c03..1e06ced 100644 --- a/src/dfuhelper.c +++ b/src/dfuhelper.c @@ -91,9 +91,6 @@ void* connected_recovery_mode(struct irecv_device_info* info) { cpid = info->cpid; ecid = info->ecid; bdid = info->bdid; -#if defined(__APPLE__) || defined(__linux__) - pthread_setname_np("in.palera.recovery-mode-handler"); -#endif if (!cpid_is_arm64(info->cpid)) { LOG(LOG_WARNING, "Ignoring non-arm64 device..."); return NULL; @@ -142,9 +139,6 @@ void* connected_recovery_mode(struct irecv_device_info* info) { } void* connected_dfu_mode(struct irecv_device_info* info) { -#if defined(__APPLE__) || defined(__linux__) - pthread_setname_np("in.palera.dfu-mode-handler"); -#endif if (get_ecid_wait_for_dfu() == info->ecid) { set_ecid_wait_for_dfu(0); puts(""); @@ -190,9 +184,6 @@ void irecv_device_event_cb(const irecv_device_event_t *event, void* userdata) { void *dfuhelper(void* ptr) { dfuhelper_thr_running = true; -#if defined(__APPLE__) || defined(__linux__) - pthread_setname_np("in.palera.dfu-helper"); -#endif subscribe_cmd(device_event_cb, irecv_device_event_cb); set_spin(1); while (get_spin()) { diff --git a/src/main.c b/src/main.c index d456f4c..9632fb0 100644 --- a/src/main.c +++ b/src/main.c @@ -66,7 +66,7 @@ int build_checks() { return -1; } if (c1_header->cputype != _mh_execute_header.cputype) { - LOG(LOG_FATAL, "Broken build: checkra1n CPU type is not the same as %s CPU type", getprogname()); + LOG(LOG_FATAL, "Broken build: checkra1n CPU type does not match palera1n CPU type"); return -1; } #endif @@ -91,9 +91,6 @@ bool use_tui = false, tui_started = false; int palera1n(int argc, char *argv[]) { int ret = 0; -#if defined(__APPLE__) || defined(__linux__) - pthread_setname_np("in.palera.main-thread"); -#endif pthread_mutex_init(&log_mutex, NULL); pthread_mutex_init(&spin_mutex, NULL); pthread_mutex_init(&found_pongo_mutex, NULL); diff --git a/src/override_file.c b/src/override_file.c index 4a27880..fc8ddd9 100644 --- a/src/override_file.c +++ b/src/override_file.c @@ -31,7 +31,7 @@ int override_file(override_file_t *finfo, niarelap_file_t** orig, unsigned int * return errno; } LOG(LOG_VERBOSE5, "override_file: fstat fd %d succeeded!", fd); - void *addr = mmap(NULL, st.st_size, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, 0); + void *addr = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); if (addr == MAP_FAILED) { LOG(LOG_ERROR, "Failed to map file %s: %d (%s)", filename, errno, strerror(errno)); return errno; diff --git a/src/pongo_helper.c b/src/pongo_helper.c index 969059d..6096b87 100644 --- a/src/pongo_helper.c +++ b/src/pongo_helper.c @@ -18,9 +18,6 @@ int pongo_thr_running = 0; void* pongo_helper(void* ptr) { pongo_thr_running = 1; pthread_cleanup_push(thr_cleanup, &pongo_thr_running); -#if defined(__APPLE__) || defined(__linux__) - pthread_setname_np("in.palera.pongo-helper"); -#endif wait_for_pongo(); while (get_spin()) { sleep(1); @@ -33,9 +30,6 @@ void *pongo_usb_callback(void *arg) { if (get_found_pongo()) return NULL; set_found_pongo(1); -#if defined(__APPLE__) || defined(__linux__) - pthread_setname_np("in.palera.pongo-handler"); -#endif strncat(xargs_cmd, " rootdev=md0", 0x270 - strlen(xargs_cmd) - 1); if (checkrain_option_enabled(palerain_flags, palerain_option_setup_rootful)) { strncat(xargs_cmd, " wdt=-1", 0x270 - strlen(xargs_cmd) - 1);