mirror of
https://github.com/brl/mutter.git
synced 2025-03-06 13:18:15 +00:00
xwayland: rename lockfile to lock_file
The missing underscore is inconsistent with the coding style of the surrounding code. https://bugzilla.gnome.org/show_bug.cgi?id=748380
This commit is contained in:
parent
a8a5da768a
commit
8937c32cd5
@ -43,7 +43,7 @@ typedef struct
|
|||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
int display_index;
|
int display_index;
|
||||||
char *lockfile;
|
char *lock_file;
|
||||||
int abstract_fd;
|
int abstract_fd;
|
||||||
int unix_fd;
|
int unix_fd;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
@ -182,7 +182,7 @@ try_display (int display,
|
|||||||
|
|
||||||
if (kill (other, 0) < 0 && errno == ESRCH)
|
if (kill (other, 0) < 0 && errno == ESRCH)
|
||||||
{
|
{
|
||||||
/* Process is dead. Try unlinking the lockfile and trying again. */
|
/* Process is dead. Try unlinking the lock file and trying again. */
|
||||||
if (unlink (filename) < 0)
|
if (unlink (filename) < 0)
|
||||||
{
|
{
|
||||||
g_warning ("failed to unlink stale lock file %s: %m", filename);
|
g_warning ("failed to unlink stale lock file %s: %m", filename);
|
||||||
@ -221,7 +221,7 @@ try_display (int display,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
create_lockfile (int display, int *display_out)
|
create_lock_file (int display, int *display_out)
|
||||||
{
|
{
|
||||||
char *filename;
|
char *filename;
|
||||||
int fd;
|
int fd;
|
||||||
@ -354,7 +354,7 @@ static gboolean
|
|||||||
choose_xdisplay (MetaXWaylandManager *manager)
|
choose_xdisplay (MetaXWaylandManager *manager)
|
||||||
{
|
{
|
||||||
int display = 0;
|
int display = 0;
|
||||||
char *lockfile = NULL;
|
char *lock_file = NULL;
|
||||||
|
|
||||||
/* Hack to keep the unused Xwayland instance on
|
/* Hack to keep the unused Xwayland instance on
|
||||||
* the login screen from taking the prime :0 display
|
* the login screen from taking the prime :0 display
|
||||||
@ -365,8 +365,8 @@ choose_xdisplay (MetaXWaylandManager *manager)
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
lockfile = create_lockfile (display, &display);
|
lock_file = create_lock_file (display, &display);
|
||||||
if (!lockfile)
|
if (!lock_file)
|
||||||
{
|
{
|
||||||
g_warning ("Failed to create an X lock file");
|
g_warning ("Failed to create an X lock file");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -375,7 +375,7 @@ choose_xdisplay (MetaXWaylandManager *manager)
|
|||||||
manager->abstract_fd = bind_to_abstract_socket (display);
|
manager->abstract_fd = bind_to_abstract_socket (display);
|
||||||
if (manager->abstract_fd < 0)
|
if (manager->abstract_fd < 0)
|
||||||
{
|
{
|
||||||
unlink (lockfile);
|
unlink (lock_file);
|
||||||
|
|
||||||
if (errno == EADDRINUSE)
|
if (errno == EADDRINUSE)
|
||||||
{
|
{
|
||||||
@ -389,7 +389,7 @@ choose_xdisplay (MetaXWaylandManager *manager)
|
|||||||
manager->unix_fd = bind_to_unix_socket (display);
|
manager->unix_fd = bind_to_unix_socket (display);
|
||||||
if (manager->abstract_fd < 0)
|
if (manager->abstract_fd < 0)
|
||||||
{
|
{
|
||||||
unlink (lockfile);
|
unlink (lock_file);
|
||||||
close (manager->abstract_fd);
|
close (manager->abstract_fd);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -400,7 +400,7 @@ choose_xdisplay (MetaXWaylandManager *manager)
|
|||||||
|
|
||||||
manager->display_index = display;
|
manager->display_index = display;
|
||||||
manager->display_name = g_strdup_printf (":%d", manager->display_index);
|
manager->display_name = g_strdup_printf (":%d", manager->display_index);
|
||||||
manager->lockfile = lockfile;
|
manager->lock_file = lock_file;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -506,8 +506,8 @@ meta_xwayland_start (MetaXWaylandManager *manager,
|
|||||||
out:
|
out:
|
||||||
if (!started)
|
if (!started)
|
||||||
{
|
{
|
||||||
unlink (manager->lockfile);
|
unlink (manager->lock_file);
|
||||||
g_clear_pointer (&manager->lockfile, g_free);
|
g_clear_pointer (&manager->lock_file, g_free);
|
||||||
}
|
}
|
||||||
return started;
|
return started;
|
||||||
}
|
}
|
||||||
@ -532,5 +532,5 @@ meta_xwayland_stop (MetaXWaylandManager *manager)
|
|||||||
snprintf (path, sizeof path, "/tmp/.X11-unix/X%d", manager->display_index);
|
snprintf (path, sizeof path, "/tmp/.X11-unix/X%d", manager->display_index);
|
||||||
unlink (path);
|
unlink (path);
|
||||||
|
|
||||||
unlink (manager->lockfile);
|
unlink (manager->lock_file);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user