}
if (&p->link == &child_process_list) {
- fprintf(stderr, "unknown child process exited\n");
+ weston_log("unknown child process exited\n");
return 1;
}
* non-CLOEXEC fd to pass through exec. */
clientfd = dup(sockfd);
if (clientfd == -1) {
- fprintf(stderr, "compositor: dup failed: %m\n");
+ weston_log("compositor: dup failed: %m\n");
return;
}
setenv("WAYLAND_SOCKET", s, 1);
if (execl(path, path, NULL) < 0)
- fprintf(stderr, "compositor: executing '%s' failed: %m\n",
+ weston_log("compositor: executing '%s' failed: %m\n",
path);
}
struct wl_client *client;
if (os_socketpair_cloexec(AF_UNIX, SOCK_STREAM, 0, sv) < 0) {
- fprintf(stderr, "weston_client_launch: "
+ weston_log("weston_client_launch: "
"socketpair failed while launching '%s': %m\n",
path);
return NULL;
if (pid == -1) {
close(sv[0]);
close(sv[1]);
- fprintf(stderr, "weston_client_launch: "
+ weston_log("weston_client_launch: "
"fork failed while launching '%s': %m\n", path);
return NULL;
}
client = wl_client_create(compositor->wl_display, sv[0]);
if (!client) {
close(sv[0]);
- fprintf(stderr, "weston_client_launch: "
+ weston_log("weston_client_launch: "
"wl_client_create failed while launching '%s'.\n",
path);
return NULL;
weston_matrix_transform(&surface->transform.matrix, &v);
if (fabsf(v.f[3]) < 1e-6) {
- fprintf(stderr, "warning: numerical instability in "
+ weston_log("warning: numerical instability in "
"weston_surface_to_global(), divisor = %g\n",
v.f[3]);
*x = 0;
if (weston_matrix_invert(inverse, matrix) < 0) {
/* Oops, bad total transformation, not invertible */
- fprintf(stderr, "error: weston_surface %p"
+ weston_log("error: weston_surface %p"
" transformation not invertible.\n", surface);
return -1;
}
weston_matrix_transform(&surface->transform.inverse, &v);
if (fabsf(v.f[3]) < 1e-6) {
- fprintf(stderr, "warning: numerical instability in "
+ weston_log("warning: numerical instability in "
"weston_surface_from_global(), divisor = %g\n",
v.f[3]);
*sx = 0;
find_resource_for_client(&seat->touch->resource_list,
surface->resource.client);
if (!resource) {
- fprintf(stderr, "couldn't find resource\n");
+ weston_log("couldn't find resource\n");
return;
}
if (ec->xkb_context == NULL) {
ec->xkb_context = xkb_context_new(0);
if (ec->xkb_context == NULL) {
- fprintf(stderr, "failed to create XKB context\n");
+ weston_log("failed to create XKB context\n");
exit(1);
}
}
keymap_str = xkb_map_get_as_string(xkb_info->keymap);
if (keymap_str == NULL) {
- fprintf(stderr, "failed to get string version of keymap\n");
+ weston_log("failed to get string version of keymap\n");
exit(EXIT_FAILURE);
}
xkb_info->keymap_size = strlen(keymap_str) + 1;
xkb_info->keymap_fd = os_create_anonymous_file(xkb_info->keymap_size);
if (xkb_info->keymap_fd < 0) {
- fprintf(stderr,
- "creating a keymap file for %lu bytes failed: %m\n",
+ weston_log("creating a keymap file for %lu bytes failed: %m\n",
(unsigned long) xkb_info->keymap_size);
goto err_keymap_str;
}
PROT_READ | PROT_WRITE,
MAP_SHARED, xkb_info->keymap_fd, 0);
if (xkb_info->keymap_area == MAP_FAILED) {
- fprintf(stderr, "failed to mmap() %lu bytes\n",
+ weston_log("failed to mmap() %lu bytes\n",
(unsigned long) xkb_info->keymap_size);
goto err_dev_zero;
}
&ec->xkb_names,
0);
if (ec->xkb_info.keymap == NULL) {
- fprintf(stderr, "failed to compile global XKB keymap\n");
- fprintf(stderr,
- " tried rules %s, model %s, layout %s, variant %s, "
+ weston_log("failed to compile global XKB keymap\n");
+ weston_log(" tried rules %s, model %s, layout %s, variant %s, "
"options %s",
ec->xkb_names.rules, ec->xkb_names.model,
ec->xkb_names.layout, ec->xkb_names.variant,
seat->xkb_state.state = xkb_state_new(seat->xkb_info.keymap);
if (seat->xkb_state.state == NULL) {
- fprintf(stderr, "failed to initialise XKB state\n");
+ weston_log("failed to initialise XKB state\n");
exit(1);
}
glGetShaderiv(s, GL_COMPILE_STATUS, &status);
if (!status) {
glGetShaderInfoLog(s, sizeof msg, NULL, msg);
- fprintf(stderr, "shader info: %s\n", msg);
+ weston_log("shader info: %s\n", msg);
return GL_NONE;
}
glGetProgramiv(shader->program, GL_LINK_STATUS, &status);
if (!status) {
glGetProgramInfoLog(shader->program, sizeof msg, NULL, msg);
- fprintf(stderr, "link info: %s\n", msg);
+ weston_log("link info: %s\n", msg);
return -1;
}
extensions = (const char *) glGetString(GL_EXTENSIONS);
if (!extensions) {
- fprintf(stderr, "Retrieving GL extension string failed.\n");
+ weston_log("Retrieving GL extension string failed.\n");
return -1;
}
if (!strstr(extensions, "GL_EXT_texture_format_BGRA8888")) {
- fprintf(stderr,
- "GL_EXT_texture_format_BGRA8888 not available\n");
+ weston_log("GL_EXT_texture_format_BGRA8888 not available\n");
return -1;
}
extensions =
(const char *) eglQueryString(ec->display, EGL_EXTENSIONS);
if (!extensions) {
- fprintf(stderr, "Retrieving EGL extension string failed.\n");
+ weston_log("Retrieving EGL extension string failed.\n");
return -1;
}
{
struct wl_display *display = data;
- fprintf(stderr, "caught signal %d\n", signal_number);
+ weston_log("caught signal %d\n", signal_number);
wl_display_terminate(display);
return 1;
int i, count;
Dl_info info;
- fprintf(stderr, "caught segv\n");
+ weston_log("caught segv\n");
count = backtrace(buffer, ARRAY_LENGTH(buffer));
for (i = 0; i < count; i++) {
dladdr(buffer[i], &info);
- fprintf(stderr, " [%016lx] %s (%s)\n",
+ weston_log(" [%016lx] %s (%s)\n",
(long) buffer[i],
info.dli_sname ? info.dli_sname : "--",
info.dli_fname);
module = dlopen(path, RTLD_LAZY);
if (!module) {
- fprintf(stderr,
- "failed to load module '%s': %s\n", path, dlerror());
+ weston_log("failed to load module '%s': %s\n", path, dlerror());
return NULL;
}
init = dlsym(module, entrypoint);
if (!init) {
- fprintf(stderr,
- "failed to lookup init function in '%s': %s\n",
+ weston_log("failed to lookup init function in '%s': %s\n",
path, dlerror());
return NULL;
}
ARRAY_LENGTH(core_options), argc, argv);
if (!getenv("XDG_RUNTIME_DIR")) {
- fprintf(stderr, xdg_error_message);
+ weston_log(xdg_error_message);
exit(EXIT_FAILURE);
}
ec = backend_init(display, argc, argv, config_file);
if (ec == NULL) {
- fprintf(stderr, "failed to create compositor\n");
+ weston_log("failed to create compositor\n");
exit(EXIT_FAILURE);
}
for (i = 1; argv[i]; i++)
- fprintf(stderr, "unhandled option: %s\n", argv[i]);
+ weston_log("unhandled option: %s\n", argv[i]);
if (argv[1])
exit(EXIT_FAILURE);
exit(EXIT_FAILURE);
if (wl_display_add_socket(display, socket_name)) {
- fprintf(stderr, "failed to add socket: %m\n");
+ weston_log("failed to add socket: %m\n");
exit(EXIT_FAILURE);
}