summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2009-08-04 00:42:40 +0200
committerGravatar Nikias Bassen2009-08-04 00:42:40 +0200
commitf6ee6302f7d87294b7175b4b639b293aafb80424 (patch)
tree9da4a0b057c287fd0e3f168765e5aa46aeda299e
parentbfdcd3a071fb73ac43715a2900db292f88d7cc47 (diff)
downloadusbmuxd-f6ee6302f7d87294b7175b4b639b293aafb80424.tar.gz
usbmuxd-f6ee6302f7d87294b7175b4b639b293aafb80424.tar.bz2
Revert "Add udev mode of operation"
This reverts commit b7d4f48d7e85c43f0dd1111619acf79aba535371. Not working as expected.
-rw-r--r--src/main.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/src/main.c b/src/main.c
index de68242..ee633b6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -58,7 +58,6 @@ static int verbose = DEBUG_LEVEL;
static int foreground = 0;
static int exit_on_no_devices = 0;
static int drop_privileges = 0;
-static int udev = 0;
struct device_info {
uint32_t device_id;
@@ -1031,7 +1030,6 @@ static void usage()
printf("\t-f|--foreground do not daemonize\n");
printf("\t-e|--exit-on-no-devices exit if no device is attached\n");
printf("\t-d|--drop-privileges drop privileges after startup\n");
- printf("\t-u|--udev use udev mode of operations\n");
printf("\n");
}
@@ -1043,13 +1041,12 @@ static void parse_opts(int argc, char **argv)
{"verbose", 0, NULL, 'v'},
{"exit-on-no-devices", 0, NULL, 'e'},
{"drop-privileges", 0, NULL, 'd'},
- {"udev", 0, NULL, 'u'},
{NULL, 0, NULL, 0}
};
int c;
while (1) {
- c = getopt_long(argc, argv, "hfvedu", longopts, (int *) 0);
+ c = getopt_long(argc, argv, "hfved", longopts, (int *) 0);
if (c == -1) {
break;
}
@@ -1070,17 +1067,11 @@ static void parse_opts(int argc, char **argv)
case 'd':
drop_privileges = 1;
break;
- case 'u':
- udev = 1;
- break;
default:
usage();
exit(2);
}
}
-
- if (udev)
- foreground = 0;
}
/**
@@ -1182,12 +1173,9 @@ int main(int argc, char **argv)
fcntl(fileno(lfd), F_GETLK, &lock);
fclose(lfd);
if (lock.l_type != F_UNLCK) {
- if (!udev) {
- logmsg(LOG_NOTICE,
- "another instance is already running. exiting.");
- return -1;
- }
- return 0;
+ logmsg(LOG_NOTICE,
+ "another instance is already running. exiting.");
+ return -1;
}
}
@@ -1277,7 +1265,6 @@ int main(int argc, char **argv)
if (result <= 0) {
if (result == 0) {
// cleanup
- int num_children = 0;
for (i = 0; i < children_capacity; i++) {
if (children[i]) {
if (children[i]->dead != 0) {
@@ -1290,7 +1277,6 @@ int main(int argc, char **argv)
children[i] = NULL;
cnt++;
} else {
- num_children++;
cnt = 0;
}
} else {
@@ -1298,9 +1284,6 @@ int main(int argc, char **argv)
}
}
- if (num_children == 0 && udev)
- break;
-
if ((children_capacity > DEFAULT_CHILDREN_CAPACITY)
&& ((children_capacity - cnt) <=
DEFAULT_CHILDREN_CAPACITY)) {