xwayland: Use %m instead of explicit strerror

This commit is contained in:
Jasper St. Pierre 2014-04-17 14:42:41 -04:00
parent 57cc68096b
commit 14deeef8a7

View File

@ -142,8 +142,7 @@ create_lockfile (int display, int *display_out)
fd = open (filename, O_CLOEXEC, O_RDONLY); fd = open (filename, O_CLOEXEC, O_RDONLY);
if (fd < 0 || read (fd, pid, 11) != 11) if (fd < 0 || read (fd, pid, 11) != 11)
{ {
const char *msg = strerror (errno); g_warning ("can't read lock file %s: %m", filename);
g_warning ("can't read lock file %s: %s", filename, msg);
g_free (filename); g_free (filename);
/* ignore error and try the next display number */ /* ignore error and try the next display number */
@ -167,8 +166,7 @@ create_lockfile (int display, int *display_out)
{ {
if (unlink (filename) < 0) if (unlink (filename) < 0)
{ {
const char *msg = strerror (errno); g_warning ("failed to unlink stale lock file: %m");
g_warning ("failed to unlink stale lock file: %s", msg);
display++; display++;
} }
g_free (filename); g_free (filename);
@ -181,8 +179,7 @@ create_lockfile (int display, int *display_out)
} }
else if (fd < 0) else if (fd < 0)
{ {
const char *msg = strerror (errno); g_warning ("failed to create lock file %s: %m", filename);
g_warning ("failed to create lock file %s: %s", filename , msg);
g_free (filename); g_free (filename);
return NULL; return NULL;
} }