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
This commit is contained in:
commit
78ea2374c5
|
@ -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);
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue