winemenubuilder: Use spawnvp() instead of system() to launch the xdg update scripts.
This commit is contained in:
parent
5f23006441
commit
afe626fb99
|
@ -2525,29 +2525,16 @@ static void RefreshFileTypeAssociations(void)
|
||||||
hasChanged |= cleanup_associations();
|
hasChanged |= cleanup_associations();
|
||||||
if (hasChanged)
|
if (hasChanged)
|
||||||
{
|
{
|
||||||
char *command = heap_printf("update-mime-database %s", mime_dir);
|
const char *argv[3];
|
||||||
if (command)
|
|
||||||
{
|
|
||||||
system(command);
|
|
||||||
HeapFree(GetProcessHeap(), 0, command);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
WINE_ERR("out of memory\n");
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
|
|
||||||
command = heap_printf("update-desktop-database %s/applications", xdg_data_dir);
|
argv[0] = "update-mime-database";
|
||||||
if (command)
|
argv[1] = mime_dir;
|
||||||
{
|
argv[2] = NULL;
|
||||||
system(command);
|
spawnvp( _P_NOWAIT, argv[0], argv );
|
||||||
HeapFree(GetProcessHeap(), 0, command);
|
|
||||||
}
|
argv[0] = "update-desktop-database";
|
||||||
else
|
argv[1] = applications_dir;
|
||||||
{
|
spawnvp( _P_NOWAIT, argv[0], argv );
|
||||||
WINE_ERR("out of memory\n");
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
|
Loading…
Reference in New Issue