mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
client: minor modernizations
This commit is contained in:
parent
6ce7d208f0
commit
8343360da1
1 changed files with 4 additions and 7 deletions
|
|
@ -701,9 +701,8 @@ static int context_autospawn(pa_context *c) {
|
||||||
/* Child */
|
/* Child */
|
||||||
|
|
||||||
const char *state = NULL;
|
const char *state = NULL;
|
||||||
#define MAX_ARGS 64
|
const char * argv[32];
|
||||||
const char * argv[MAX_ARGS+1];
|
unsigned n = 0;
|
||||||
int n;
|
|
||||||
|
|
||||||
if (c->spawn_api.atfork)
|
if (c->spawn_api.atfork)
|
||||||
c->spawn_api.atfork();
|
c->spawn_api.atfork();
|
||||||
|
|
@ -712,12 +711,10 @@ static int context_autospawn(pa_context *c) {
|
||||||
|
|
||||||
/* Setup argv */
|
/* Setup argv */
|
||||||
|
|
||||||
n = 0;
|
|
||||||
|
|
||||||
argv[n++] = c->conf->daemon_binary;
|
argv[n++] = c->conf->daemon_binary;
|
||||||
argv[n++] = "--start";
|
argv[n++] = "--start";
|
||||||
|
|
||||||
while (n < MAX_ARGS) {
|
while (n < PA_ELEMENTSOF(argv)-1) {
|
||||||
char *a;
|
char *a;
|
||||||
|
|
||||||
if (!(a = pa_split_spaces(c->conf->extra_arguments, &state)))
|
if (!(a = pa_split_spaces(c->conf->extra_arguments, &state)))
|
||||||
|
|
@ -727,10 +724,10 @@ static int context_autospawn(pa_context *c) {
|
||||||
}
|
}
|
||||||
|
|
||||||
argv[n++] = NULL;
|
argv[n++] = NULL;
|
||||||
|
pa_assert(n <= PA_ELEMENTSOF(argv));
|
||||||
|
|
||||||
execv(argv[0], (char * const *) argv);
|
execv(argv[0], (char * const *) argv);
|
||||||
_exit(1);
|
_exit(1);
|
||||||
#undef MAX_ARGS
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parent */
|
/* Parent */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue