diff options
author | Michael R Sweet <michael.r.sweet@gmail.com> | 2021-04-05 15:09:07 -0400 |
---|---|---|
committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2021-04-05 15:09:07 -0400 |
commit | 6918883fba4942931dc455b32545d6edf18dec5c (patch) | |
tree | c54d2dfa7ff4abca67577199f622d564151c3193 /backend/usb-darwin.c | |
parent | b27a49b8a06e65067b1ca950d39b34ae8b2fa008 (diff) | |
download | cups-6918883fba4942931dc455b32545d6edf18dec5c.tar.gz |
Update Github repository to match macOS 11.2 CUPS sources (cups-494.1).
Diffstat (limited to 'backend/usb-darwin.c')
-rw-r--r-- | backend/usb-darwin.c | 55 |
1 files changed, 18 insertions, 37 deletions
diff --git a/backend/usb-darwin.c b/backend/usb-darwin.c index 0d009f0ad..3f03630f0 100644 --- a/backend/usb-darwin.c +++ b/backend/usb-darwin.c @@ -288,11 +288,11 @@ static void status_timer_cb(CFRunLoopTimerRef timer, void *info); #define IS_64BIT 1 #define IS_NOT_64BIT 0 -#if defined(__i386__) || defined(__x86_64__) +#if defined(__arm64e__) static pid_t child_pid; /* Child PID */ -static void run_legacy_backend(int argc, char *argv[], int fd) _CUPS_NORETURN; /* Starts child backend process running as a ppc executable */ -#endif /* __i386__ || __x86_64__ */ -static void sigterm_handler(int sig); /* SIGTERM handler */ +static void run_legacy_backend(int argc, char *argv[], int fd) _CUPS_NORETURN; /* Starts child backend process running as a x86_64 executable */ +static void sigterm_handler(int sig); /* SIGTERM handler */ +#endif /* __arm64e__ */ static void sigquit_handler(int sig, siginfo_t *si, void *unused) _CUPS_NORETURN; #ifdef PARSE_PS_ERRORS @@ -436,18 +436,18 @@ print_device(const char *uri, /* I - Device URI */ status = registry_open(&driverBundlePath); -#if defined(__i386__) || defined(__x86_64__) +#if defined(__arm64e__) /* * If we were unable to load the class drivers for this printer it's - * probably because they're ppc or i386. In this case try to run this - * backend as i386 or ppc executables so we can use them... + * probably because they're x86_64 (or older). In this case try to run this + * backend as x86_64 so we can use them... */ if (status == -2) { run_legacy_backend(argc, argv, print_fd); /* Never returns here */ } -#endif /* __i386__ || __x86_64__ */ +#endif /* __arm64e__ */ if (status == -2) { @@ -2053,11 +2053,11 @@ static void setup_cfLanguage(void) } #pragma mark - -#if defined(__i386__) || defined(__x86_64__) +#if defined(__arm64e__) /*! * @function run_legacy_backend * - * @abstract Starts child backend process running as a ppc or i386 executable. + * @abstract Starts child backend process running as a x86_64 executable. * * @result Never returns; always calls exit(). * @@ -2076,18 +2076,14 @@ static void run_legacy_backend(int argc, /* - * If we're running as x86_64 or i386 and couldn't load the class driver - * (because it's ppc or i386), then try to re-exec ourselves in ppc or i386 - * mode to try again. If we don't have a ppc or i386 architecture we may be + * If we're running as ARM and couldn't load the class driver + * (because it's x86_64, i386 or ppc), then try to re-exec ourselves in x86_64 + * mode to try again. If we don't have that architecture we may be * running with the same architecture again so guard against this by setting * and testing an environment variable... */ -# ifdef __x86_64__ - usb_legacy_status = getenv("USB_I386_STATUS"); -# else - usb_legacy_status = getenv("USB_PPC_STATUS"); -# endif /* __x86_64__ */ + usb_legacy_status = getenv("USB_LEGACY_STATUS"); if (!usb_legacy_status) { @@ -2116,21 +2112,13 @@ static void run_legacy_backend(int argc, * Set the environment variable... */ -# ifdef __x86_64__ - setenv("USB_I386_STATUS", "1", false); -# else - setenv("USB_PPC_STATUS", "1", false); -# endif /* __x86_64__ */ + setenv("USB_LEGACY_STATUS", "1", false); /* * Tell the kernel to use the specified CPU architecture... */ -# ifdef __x86_64__ - cpu_type_t cpu = CPU_TYPE_I386; -# else - cpu_type_t cpu = CPU_TYPE_POWERPC; -# endif /* __x86_64__ */ + cpu_type_t cpu = CPU_TYPE_X86_64; size_t ocount = 1; posix_spawnattr_t attrs; @@ -2139,11 +2127,7 @@ static void run_legacy_backend(int argc, posix_spawnattr_setsigdefault(&attrs, &oldmask); if (posix_spawnattr_setbinpref_np(&attrs, 1, &cpu, &ocount) || ocount != 1) { -# ifdef __x86_64__ - perror("DEBUG: Unable to set binary preference to i386"); -# else - perror("DEBUG: Unable to set binary preference to ppc"); -# endif /* __x86_64__ */ + perror("DEBUG: Unable to set binary preference to X86_64"); _cupsLangPrintFilter(stderr, "ERROR", _("Unable to use legacy USB class driver.")); exit(CUPS_BACKEND_STOP); @@ -2217,8 +2201,6 @@ static void run_legacy_backend(int argc, exit(exitstatus); } -#endif /* __i386__ || __x86_64__ */ - /* * 'sigterm_handler()' - SIGTERM handler. @@ -2227,7 +2209,6 @@ static void run_legacy_backend(int argc, static void sigterm_handler(int sig) /* I - Signal */ { -#if defined(__i386__) || defined(__x86_64__) /* * If we started a child process pass the signal on to it... */ @@ -2253,8 +2234,8 @@ sigterm_handler(int sig) /* I - Signal */ _exit(CUPS_BACKEND_STOP); } } -#endif /* __i386__ || __x86_64__ */ } +#endif /* __arm64e__ */ /* |