Commit c4a3752d authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

macosx: Use fork+exec instead of posix_spawn.

(As pointed by Remi)

Note, this doesn't work with just exec() for some obscure reason.
(cherry picked from commit a921f15e)
parent 9836bd0e
......@@ -31,7 +31,7 @@
#include <sys/param.h> /* for MAXPATHLEN */
#include <string.h>
#include <vlc_keys.h>
#include <spawn.h>
#include <unistd.h> /* execl() */
#ifdef HAVE_CONFIG_H
# include "config.h"
......@@ -2261,11 +2261,14 @@ end:
/* Relaunch now */
const char * path = [[[NSBundle mainBundle] executablePath] UTF8String];
const char *spawnedArgs[2] = { path, NULL };
char *spawnedEnv[] = {NULL};
posix_spawn(NULL, path, NULL, NULL, spawnedArgs, spawnedEnv);
exit(0);
/* For some reason we need to fork(), not just execl(), which reports a ENOTSUP then. */
if(fork() != 0)
{
exit(0);
return;
}
execl(path, path, NULL);
}
#pragma mark -
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment