summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorGravatar Rick Mark2020-05-07 09:42:23 -0700
committerGravatar Rick Mark2020-05-07 09:42:23 -0700
commit45dd28e6a1ce8bcd42cc7d547c223b05ffebff9b (patch)
treec3b3ef80696c3291950d315aa4e32b78ffad0806 /src/main.c
parent68d4d1c89d462ebbeb3cf51120fe96813377a0f6 (diff)
downloadusbmuxd-45dd28e6a1ce8bcd42cc7d547c223b05ffebff9b.tar.gz
usbmuxd-45dd28e6a1ce8bcd42cc7d547c223b05ffebff9b.tar.bz2
Do not perform preflight on T2 devices
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index aede710..7c22092 100644
--- a/src/main.c
+++ b/src/main.c
@@ -53,10 +53,13 @@
static const char *socket_path = "/var/run/usbmuxd";
static const char *lockfile = "/var/run/usbmuxd.pid";
+// Global state used in other files
int should_exit;
int should_discover;
int use_logfile = 0;
+int no_preflight = 0;
+// Global state for main.c
static int verbose = 0;
static int foreground = 0;
static int drop_privileges = 0;
@@ -151,7 +154,7 @@ static void set_signal_handlers(void)
sigaddset(&set, SIGUSR1);
sigaddset(&set, SIGUSR2);
sigprocmask(SIG_SETMASK, &set, NULL);
-
+
memset(&sa, 0, sizeof(struct sigaction));
sa.sa_handler = handle_signal;
sigaction(SIGINT, &sa, NULL);
@@ -368,6 +371,7 @@ static void usage()
printf(" \tStarting another instance will trigger discovery instead.\n");
printf(" -z, --enable-exit\tEnable \"--exit\" request from other instances and exit\n");
printf(" \tautomatically if no device is attached.\n");
+ printf(" -p, --no-preflight\tDisable lockdownd preflight on new device.\n");
#ifdef HAVE_UDEV
printf(" -u, --udev\t\tRun in udev operation mode (implies -n and -z).\n");
#endif
@@ -392,6 +396,7 @@ static void parse_opts(int argc, char **argv)
{"user", required_argument, NULL, 'U'},
{"disable-hotplug", no_argument, NULL, 'n'},
{"enable-exit", no_argument, NULL, 'z'},
+ {"no-preflight", no_argument, NULL, 'p'},
#ifdef HAVE_UDEV
{"udev", no_argument, NULL, 'u'},
#endif
@@ -407,11 +412,11 @@ static void parse_opts(int argc, char **argv)
int c;
#ifdef HAVE_SYSTEMD
- const char* opts_spec = "hfvVuU:xXsnzl:";
+ const char* opts_spec = "hfvVuU:xXsnzl:p";
#elif HAVE_UDEV
- const char* opts_spec = "hfvVuU:xXnzl:";
+ const char* opts_spec = "hfvVuU:xXnzl:p";
#else
- const char* opts_spec = "hfvVU:xXnzl:";
+ const char* opts_spec = "hfvVU:xXnzl:p";
#endif
while (1) {
@@ -437,6 +442,9 @@ static void parse_opts(int argc, char **argv)
drop_privileges = 1;
drop_user = optarg;
break;
+ case 'p':
+ no_preflight = 1;
+ break;
#ifdef HAVE_UDEV
case 'u':
opt_disable_hotplug = 1;