len = read(source->fd, &expires, sizeof expires);
if (!(len == -1 && errno == EAGAIN) && len != sizeof expires)
/* Is there anything we can do here? Will this ever happen? */
- wl_log("timerfd read error: %m\n");
+ wl_log("timerfd read error: %s\n", strerror(errno));
return timer_source->func(timer_source->base.data);
}
len = read(source->fd, &signal_info, sizeof signal_info);
if (!(len == -1 && errno == EAGAIN) && len != sizeof signal_info)
/* Is there anything we can do here? Will this ever happen? */
- wl_log("signalfd read error: %m\n");
+ wl_log("signalfd read error: %s\n", strerror(errno));
return signal_source->func(signal_source->signal_number,
signal_source->base.data);
buf = XML_GetBuffer(ctx.parser, XML_BUFFER_SIZE);
len = fread(buf, 1, XML_BUFFER_SIZE, input);
if (len < 0) {
- fprintf(stderr, "fread: %m\n");
+ fprintf(stderr, "fread: %s\n", strerror(errno));
fclose(input);
exit(EXIT_FAILURE);
}
client_fd = wl_os_accept_cloexec(fd, (struct sockaddr *) &name,
&length);
if (client_fd < 0)
- wl_log("failed to accept: %m\n");
+ wl_log("failed to accept: %s\n", strerror(errno));
else
if (!wl_client_create(display, client_fd))
close(client_fd);
size = offsetof (struct sockaddr_un, sun_path) + strlen(s->addr.sun_path);
if (bind(s->fd, (struct sockaddr *) &s->addr, size) < 0) {
- wl_log("bind() failed with error: %m\n");
+ wl_log("bind() failed with error: %s\n", strerror(errno));
return -1;
}
if (listen(s->fd, 128) < 0) {
- wl_log("listen() failed with error: %m\n");
+ wl_log("listen() failed with error: %s\n", strerror(errno));
return -1;
}
#include <assert.h>
#include <signal.h>
#include <pthread.h>
+#include <errno.h>
#include "wayland-util.h"
#include "wayland-private.h"
if (pool->data == MAP_FAILED) {
wl_resource_post_error(resource,
WL_SHM_ERROR_INVALID_FD,
- "failed mmap fd %d: %m", fd);
+ "failed mmap fd %d: %s", fd,
+ strerror(errno));
goto err_free;
}
close(fd);
if (waitid(P_PID, pid, &info, WEXITED)) {
stderr_set_color(RED);
- fprintf(stderr, "waitid failed: %m\n");
+ fprintf(stderr, "waitid failed: %s\n",
+ strerror(errno));
stderr_reset_color();
abort();