summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2010-10-01 05:50:01 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-10-01 05:50:01 -0700
commit78ea2374c5c87d7bb58747b1a6173c598f386600 (patch)
tree1aba3f665deb2e9dffcf03c2b2c33ed34d8d8981 /init
parentf1fd5eb8cca9f1096c4d0de5abbbd2b264fd1b9e (diff)
parent912ff85b035e0e6bc109812c1ea5661ea4df5967 (diff)
downloadsystem_core-78ea2374c5c87d7bb58747b1a6173c598f386600.zip
system_core-78ea2374c5c87d7bb58747b1a6173c598f386600.tar.gz
system_core-78ea2374c5c87d7bb58747b1a6173c598f386600.tar.bz2
am 912ff85b: init: Add support for SOCK_SEQPACKET socket type
Merge commit '912ff85b035e0e6bc109812c1ea5661ea4df5967' into gingerbread-plus-aosp * commit '912ff85b035e0e6bc109812c1ea5661ea4df5967': init: Add support for SOCK_SEQPACKET socket type
Diffstat (limited to 'init')
-rwxr-xr-xinit/init.c7
-rw-r--r--init/init_parser.c5
-rw-r--r--init/readme.txt2
3 files changed, 8 insertions, 6 deletions
diff --git a/init/init.c b/init/init.c
index 8f95da7..75ffb5c 100755
--- a/init/init.c
+++ b/init/init.c
@@ -206,9 +206,10 @@ void service_start(struct service *svc, const char *dynamic_args)
add_environment(ei->name, ei->value);
for (si = svc->sockets; si; si = si->next) {
- int s = create_socket(si->name,
- !strcmp(si->type, "dgram") ?
- SOCK_DGRAM : SOCK_STREAM,
+ int socket_type = (
+ !strcmp(si->type, "stream") ? SOCK_STREAM :
+ (!strcmp(si->type, "dgram") ? SOCK_DGRAM : SOCK_SEQPACKET));
+ int s = create_socket(si->name, socket_type,
si->perm, si->uid, si->gid);
if (s >= 0) {
publish_socket(si->name, s);
diff --git a/init/init_parser.c b/init/init_parser.c
index 585a5b5..d136c28 100644
--- a/init/init_parser.c
+++ b/init/init_parser.c
@@ -587,8 +587,9 @@ static void parse_line_service(struct parse_state *state, int nargs, char **args
parse_error(state, "socket option requires name, type, perm arguments\n");
break;
}
- if (strcmp(args[2],"dgram") && strcmp(args[2],"stream")) {
- parse_error(state, "socket type must be 'dgram' or 'stream'\n");
+ if (strcmp(args[2],"dgram") && strcmp(args[2],"stream")
+ && strcmp(args[2],"seqpacket")) {
+ parse_error(state, "socket type must be 'dgram', 'stream' or 'seqpacket'\n");
break;
}
si = calloc(1, sizeof(*si));
diff --git a/init/readme.txt b/init/readme.txt
index a185790..df524a6 100644
--- a/init/readme.txt
+++ b/init/readme.txt
@@ -72,7 +72,7 @@ setenv <name> <value>
socket <name> <type> <perm> [ <user> [ <group> ] ]
Create a unix domain socket named /dev/socket/<name> and pass
- its fd to the launched process. <type> must be "dgram" or "stream".
+ its fd to the launched process. <type> must be "dgram", "stream" or "seqpacket".
User and group default to 0.
user <username>