forked from Mirrors/flatpak-builder
helper: Fix errors caused by create_file() return value change
parent
16b46d3579
commit
1a68b0bbf2
|
@ -889,7 +889,7 @@ create_file (const char *path, mode_t mode, const char *content)
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
res = 0;
|
res = TRUE;
|
||||||
if (content)
|
if (content)
|
||||||
res = write_to_file (fd, content, strlen (content));
|
res = write_to_file (fd, content, strlen (content));
|
||||||
|
|
||||||
|
@ -1921,7 +1921,7 @@ main (int argc,
|
||||||
char *config_path_absolute = strdup_printf ("/run/user/%d/pulse/config", getuid());
|
char *config_path_absolute = strdup_printf ("/run/user/%d/pulse/config", getuid());
|
||||||
char *client_config = strdup_printf ("enable-shm=%s\n", share_shm ? "yes" : "no");
|
char *client_config = strdup_printf ("enable-shm=%s\n", share_shm ? "yes" : "no");
|
||||||
|
|
||||||
if (!create_file (config_path_relative, 0666, client_config) == 0 &&
|
if (!create_file (config_path_relative, 0666, client_config) &&
|
||||||
bind_mount (pulseaudio_socket, pulse_path_relative, BIND_READONLY) == 0)
|
bind_mount (pulseaudio_socket, pulse_path_relative, BIND_READONLY) == 0)
|
||||||
{
|
{
|
||||||
xsetenv ("PULSE_SERVER", pulse_server, 1);
|
xsetenv ("PULSE_SERVER", pulse_server, 1);
|
||||||
|
@ -1941,7 +1941,7 @@ main (int argc,
|
||||||
|
|
||||||
if (system_dbus_socket != NULL)
|
if (system_dbus_socket != NULL)
|
||||||
{
|
{
|
||||||
if (!create_file ("run/dbus/system_bus_socket", 0666, NULL) == 0 &&
|
if (!create_file ("run/dbus/system_bus_socket", 0666, NULL) &&
|
||||||
bind_mount (system_dbus_socket, "run/dbus/system_bus_socket", 0) == 0)
|
bind_mount (system_dbus_socket, "run/dbus/system_bus_socket", 0) == 0)
|
||||||
xsetenv ("DBUS_SYSTEM_BUS_ADDRESS", "unix:path=/var/run/dbus/system_bus_socket", 1);
|
xsetenv ("DBUS_SYSTEM_BUS_ADDRESS", "unix:path=/var/run/dbus/system_bus_socket", 1);
|
||||||
else
|
else
|
||||||
|
@ -1953,7 +1953,7 @@ main (int argc,
|
||||||
char *session_dbus_socket_path_relative = strdup_printf ("run/user/%d/bus", getuid());
|
char *session_dbus_socket_path_relative = strdup_printf ("run/user/%d/bus", getuid());
|
||||||
char *session_dbus_address = strdup_printf ("unix:path=/run/user/%d/bus", getuid());
|
char *session_dbus_address = strdup_printf ("unix:path=/run/user/%d/bus", getuid());
|
||||||
|
|
||||||
if (!create_file (session_dbus_socket_path_relative, 0666, NULL) == 0 &&
|
if (!create_file (session_dbus_socket_path_relative, 0666, NULL) &&
|
||||||
bind_mount (session_dbus_socket, session_dbus_socket_path_relative, 0) == 0)
|
bind_mount (session_dbus_socket, session_dbus_socket_path_relative, 0) == 0)
|
||||||
xsetenv ("DBUS_SESSION_BUS_ADDRESS", session_dbus_address, 1);
|
xsetenv ("DBUS_SESSION_BUS_ADDRESS", session_dbus_address, 1);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue