ecore_drm/ecore_wl2: logging: remove errant usage of %m

Summary:
printf %m stringifies and prints errno.  I've tried to remove its use
anywhere that the immediately preceding function might not set errno
or is a complicated function for which knowing errno doesn't really
give any useful information.

I've left a few of the drmMode calls because they're just wrappers
around ioctl, which legitimately sets errno.

@fix

Reviewers: zmike, devilhorns

Reviewed By: zmike, devilhorns

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3572
This commit is contained in:
Derek Foreman 2016-01-14 13:05:55 -05:00 committed by Chris Michael
parent 01dc2540db
commit 943f2df006
19 changed files with 47 additions and 47 deletions

View File

@ -374,7 +374,7 @@ ecore_drm_device_open(Ecore_Drm_Device *dev)
/* try to create xkb context */
if (!(dev->xkb_ctx = _ecore_drm_device_cached_context_get(0)))
{
ERR("Failed to create xkb context: %m");
ERR("Failed to create xkb context");
return EINA_FALSE;
}
@ -544,7 +544,7 @@ ecore_drm_device_software_setup(Ecore_Drm_Device *dev)
{
if (!(dev->dumb[i] = ecore_drm_fb_create(dev, w, h)))
{
ERR("Could not create dumb framebuffer: %m");
ERR("Could not create dumb framebuffer");
goto err;
}

View File

@ -120,14 +120,14 @@ _device_keyboard_setup(Ecore_Drm_Evdev *edev)
edev->xkb.keymap = _ecore_drm_device_cached_keymap_get(input->dev->xkb_ctx, NULL, 0);
if (!edev->xkb.keymap)
{
ERR("Failed to create keymap: %m");
ERR("Failed to create keymap");
return;
}
/* create xkb state */
if (!(edev->xkb.state = xkb_state_new(edev->xkb.keymap)))
{
ERR("Failed to create xkb state: %m");
ERR("Failed to create xkb state");
return;
}

View File

@ -81,7 +81,7 @@ ecore_drm_fb_create(Ecore_Drm_Device *dev, int width, int height)
if (!_ecore_drm_fb_create2(dev->drm.fd, fb))
{
WRN("Could not add framebuffer2: %m");
WRN("Could not add framebuffer2");
if (drmModeAddFB(dev->drm.fd, fb->w, fb->h, 24, 32,
fb->stride, fb->hdl, &fb->id))
{
@ -264,7 +264,7 @@ ecore_drm_fb_send(Ecore_Drm_Device *dev, Ecore_Drm_Fb *fb, Ecore_Drm_Pageflip_Cb
ret = drmHandleEvent(dev->drm.fd, &dev->drm_ctx);
if (ret < 0)
{
ERR("drmHandleEvent Failed: %m");
ERR("drmHandleEvent Failed");
free(cb);
break;
}

View File

@ -191,7 +191,7 @@ _cb_input_dispatch(void *data, Ecore_Fd_Handler *hdlr EINA_UNUSED)
if (!(input = data)) return EINA_TRUE;
if (libinput_dispatch(input->libinput) != 0)
ERR("Failed to dispatch libinput events: %m");
ERR("Failed to dispatch libinput events");
/* process pending events */
_input_events_process(input);
@ -226,7 +226,7 @@ ecore_drm_inputs_create(Ecore_Drm_Device *dev)
libinput_udev_create_context(&_input_interface, input, eeze_udev_get());
if (!input->libinput)
{
ERR("Could not create libinput context: %m");
ERR("Could not create libinput context");
goto err;
}
@ -236,7 +236,7 @@ ecore_drm_inputs_create(Ecore_Drm_Device *dev)
/* assign udev seat */
if (libinput_udev_assign_seat(input->libinput, dev->seat) != 0)
{
ERR("Failed to assign seat: %m");
ERR("Failed to assign seat");
goto err;
}

View File

@ -21,7 +21,7 @@ _ecore_drm_launcher_cb_vt_switch(void *data, int type EINA_UNUSED, void *event)
vt = (keycode - KEY_F1 + 1);
if (!_ecore_drm_tty_switch(dev, vt))
ERR("Failed to activate vt: %m");
ERR("Failed to activate vt");
}
return ECORE_CALLBACK_PASS_ON;

View File

@ -16,7 +16,7 @@ _ecore_drm_logind_vt_get(Ecore_Drm_Device *dev)
ret = sd_session_get_vt(dev->session, &dev->vt);
if (ret < 0)
{
ERR("Could not get systemd tty: %m");
ERR("Could not get systemd tty");
return EINA_FALSE;
}
@ -185,13 +185,13 @@ _ecore_drm_logind_connect(Ecore_Drm_Device *dev)
/* get session id */
if (sd_pid_get_session(getpid(), &dev->session) < 0)
{
ERR("Could not get systemd session: %m");
ERR("Could not get systemd session");
return EINA_FALSE;
}
if (sd_session_get_seat(dev->session, &seat) < 0)
{
ERR("Could not get systemd seat: %m");
ERR("Could not get systemd seat");
return EINA_FALSE;
}
else if (strcmp(dev->seat, seat))

View File

@ -214,7 +214,7 @@ _ecore_drm_output_crtc_find(Ecore_Drm_Device *dev, drmModeRes *res, drmModeConne
/* get the encoder on this connector */
if (!(enc = drmModeGetEncoder(dev->drm.fd, conn->encoders[j])))
{
WRN("Failed to get encoder: %m");
WRN("Failed to get encoder");
continue;
}
@ -904,7 +904,7 @@ ecore_drm_outputs_create(Ecore_Drm_Device *dev)
/* get the resources */
if (!(res = drmModeGetResources(dev->drm.fd)))
{
ERR("Could not get resources for drm card: %m");
ERR("Could not get resources for drm card");
return EINA_FALSE;
}
@ -1081,7 +1081,7 @@ ecore_drm_output_repaint(Ecore_Drm_Output *output)
vbl.request.signal = (unsigned long)sprite;
ret = drmWaitVBlank(dev->drm.fd, &vbl);
if (ret) ERR("Error Wait VBlank: %m");
if (ret) ERR("Error Wait VBlank");
sprite->output = output;
output->pending_vblank = EINA_TRUE;
@ -1384,7 +1384,7 @@ ecore_drm_output_possible_crtc_get(Ecore_Drm_Output *output, unsigned int crtc)
/* get the resources */
if (!(res = drmModeGetResources(dev->drm.fd)))
{
ERR("Could not get resources for drm card: %m");
ERR("Could not get resources for drm card");
return EINA_FALSE;
}
@ -1399,7 +1399,7 @@ ecore_drm_output_possible_crtc_get(Ecore_Drm_Output *output, unsigned int crtc)
/* get the encoder on this connector */
if (!(enc = drmModeGetEncoder(dev->drm.fd, conn->encoders[j])))
{
WRN("Failed to get encoder: %m");
WRN("Failed to get encoder");
continue;
}

View File

@ -57,7 +57,7 @@ _ecore_drm_tty_setup(Ecore_Drm_Device *dev)
if ((fstat(dev->tty.fd, &st) == -1) ||
(major(st.st_rdev) != TTY_MAJOR) || (minor(st.st_rdev) == 0))
{
ERR("Failed to get stats for tty: %m");
ERR("Failed to get stats for tty");
return EINA_FALSE;
}

View File

@ -421,7 +421,7 @@ ecore_wl2_display_create(const char *name)
ewd->wl.display = wl_display_create();
if (!ewd->wl.display)
{
ERR("Could not create wayland display: %m");
ERR("Could not create wayland display");
goto create_err;
}
@ -432,7 +432,7 @@ ecore_wl2_display_create(const char *name)
n = wl_display_add_socket_auto(ewd->wl.display);
if (!n)
{
ERR("Failed to add display socket: %m");
ERR("Failed to add display socket");
goto socket_err;
}
@ -442,7 +442,7 @@ ecore_wl2_display_create(const char *name)
{
if (wl_display_add_socket(ewd->wl.display, name))
{
ERR("Failed to add display socket: %m");
ERR("Failed to add display socket");
goto socket_err;
}
@ -561,7 +561,7 @@ ecore_wl2_display_connect(const char *name)
ewd->wl.display = wl_display_connect(ewd->name);
if (!ewd->wl.display)
{
ERR("Could not connect to display %s: %m", ewd->name);
ERR("Could not connect to display %s", ewd->name);
goto connect_err;
}

View File

@ -446,7 +446,7 @@ ecore_wl2_dnd_drag_types_set(Ecore_Wl2_Input *input, const char **types)
input->data.source = wl_data_device_manager_create_data_source(manager);
if (!input->data.source)
{
ERR("Could not create data source: %m");
ERR("Could not create data source");
return;
}
@ -573,7 +573,7 @@ ecore_wl2_dnd_selection_set(Ecore_Wl2_Input *input, const char **types)
input->data.source = wl_data_device_manager_create_data_source(manager);
if (!input->data.source)
{
ERR("Could not create data source: %m");
ERR("Could not create data source");
return EINA_FALSE;
}

View File

@ -684,7 +684,7 @@ _keyboard_cb_keymap(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsign
input->xkb.state = xkb_state_new(input->xkb.keymap);
if (!input->xkb.state)
{
ERR("Failed to create keymap state: %m");
ERR("Failed to create keymap state");
xkb_map_unref(input->xkb.keymap);
input->xkb.keymap = NULL;
return;

View File

@ -33,7 +33,7 @@ _seat_cb_bind(struct wl_client *client, void *data, uint32_t version, uint32_t i
res = wl_resource_create(client, &wl_seat_interface, version, id);
if (!res)
{
ERR("Failed to create seat resource: %m");
ERR("Failed to create seat resource");
return;
}
@ -152,7 +152,7 @@ ecore_wl2_seat_create(Ecore_Wl2_Display *display, const char *name, const struct
seat, _seat_cb_bind);
if (!seat->global)
{
ERR("Could not create seat global: %m");
ERR("Could not create seat global");
free(seat);
return NULL;
}
@ -255,7 +255,7 @@ ecore_wl2_pointer_resource_create(Ecore_Wl2_Pointer *ptr, struct wl_client *clie
res = wl_resource_create(client, &wl_pointer_interface, version, id);
if (!res)
{
ERR("Could not create pointer resource: %m");
ERR("Could not create pointer resource");
wl_client_post_no_memory(client);
return EINA_FALSE;
}
@ -315,7 +315,7 @@ ecore_wl2_keyboard_resource_create(Ecore_Wl2_Keyboard *kbd, struct wl_client *cl
res = wl_resource_create(client, &wl_keyboard_interface, version, id);
if (!res)
{
ERR("Could not create keyboard resource: %m");
ERR("Could not create keyboard resource");
wl_client_post_no_memory(client);
return EINA_FALSE;
}

View File

@ -44,7 +44,7 @@ ecore_wl2_subsurface_new(Ecore_Wl2_Window *window)
subsurf->wl.surface = wl_compositor_create_surface(display->wl.compositor);
if (!subsurf->wl.surface)
{
ERR("Failed to create surface: %m");
ERR("Failed to create surface");
goto surf_err;
}
@ -53,7 +53,7 @@ ecore_wl2_subsurface_new(Ecore_Wl2_Window *window)
subsurf->wl.surface, window->surface);
if (!subsurf->wl.subsurface)
{
ERR("Could not create subsurface: %m");
ERR("Could not create subsurface");
goto sub_surf_err;
}
@ -163,7 +163,7 @@ ecore_wl2_subsurface_opaque_region_set(Ecore_Wl2_Subsurface *subsurface, int x,
wl_compositor_create_region(parent->display->wl.compositor);
if (!region)
{
ERR("Failed to create opaque region: %m");
ERR("Failed to create opaque region");
return;
}

View File

@ -184,7 +184,7 @@ _ecore_wl2_window_type_set(Ecore_Wl2_Window *win)
win->geometry.x, win->geometry.y);
if (!win->xdg_popup)
{
ERR("Could not create xdg popup: %m");
ERR("Could not create xdg popup");
return;
}
@ -257,7 +257,7 @@ _ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
return;
surf_err:
ERR("Failed to create surface for window: %m");
ERR("Failed to create surface for window");
}
EAPI Ecore_Wl2_Window *
@ -338,7 +338,7 @@ ecore_wl2_window_show(Ecore_Wl2_Window *window)
wl_compositor_create_surface(window->display->wl.compositor);
if (!window->surface)
{
ERR("Failed to create surface for window: %m");
ERR("Failed to create surface for window");
return;
}
}
@ -536,7 +536,7 @@ ecore_wl2_window_opaque_region_set(Ecore_Wl2_Window *window, int x, int y, int w
region = wl_compositor_create_region(window->display->wl.compositor);
if (!region)
{
ERR("Failed to create opaque region: %m");
ERR("Failed to create opaque region");
return;
}
@ -577,7 +577,7 @@ ecore_wl2_window_input_region_set(Ecore_Wl2_Window *window, int x, int y, int w,
region = wl_compositor_create_region(window->display->wl.compositor);
if (!region)
{
ERR("Failed to create opaque region: %m");
ERR("Failed to create opaque region");
return;
}

View File

@ -563,21 +563,21 @@ _ecore_evas_drm_init(const char *device)
/* try to create sprites */
if (!ecore_drm_sprites_create(dev))
{
ERR("Could not create sprites: %m");
ERR("Could not create sprites");
goto sprite_err;
}
/* try to create outputs */
if (!ecore_drm_outputs_create(dev))
{
ERR("Could not create outputs: %m");
ERR("Could not create outputs");
goto output_err;
}
/* try to create inputs */
if (!ecore_drm_inputs_create(dev))
{
ERR("Could not create inputs: %m");
ERR("Could not create inputs");
goto input_err;
}

View File

@ -125,7 +125,7 @@ eng_gbm_init(Evas_Engine_Info_GL_Drm *info)
if (!(info->info.gbm = gbm_create_device(dev->drm.fd)))
{
ERR("Coult not create gbm device: %m");
ERR("Coult not create gbm device");
return EINA_FALSE;
}
@ -382,7 +382,7 @@ evgl_eng_native_window_create(void *data)
info->info.format, info->info.flags);
if (!surface)
{
ERR("Could not create gl drm window: %m");
ERR("Could not create gl drm window");
return NULL;
}

View File

@ -31,7 +31,7 @@ _evas_outbuf_gbm_surface_create(Outbuf *ob, int w, int h)
gbm_surface_create(ob->info->info.gbm, w, h,
ob->info->info.format, ob->info->info.flags);
if (!ob->surface) ERR("Failed to create gbm surface: %m");
if (!ob->surface) ERR("Failed to create gbm surface");
}
static void
@ -117,7 +117,7 @@ _evas_outbuf_buffer_swap(Outbuf *ob, Eina_Rectangle *rects, unsigned int count)
ob->priv.bo[ob->priv.curr] = gbm_surface_lock_front_buffer(ob->surface);
if (!ob->priv.bo[ob->priv.curr])
{
WRN("Could not lock front buffer: %m");
WRN("Could not lock front buffer");
return;
}

View File

@ -285,7 +285,7 @@ evgl_eng_native_window_create(void *data)
if (!(win = wl_egl_window_create(ob->info->info.surface, 1, 1)))
{
ERR("Could not create wl_egl window: %m");
ERR("Could not create wl_egl window");
return NULL;
}

View File

@ -184,7 +184,7 @@ _shm_data_create_from_pool(Shm_Pool *pool, int w, int h, Eina_Bool alpha)
(w * sizeof(int)), wl_format);
if (!data->buffer)
{
ERR("Could not create buffer from pool: %m");
ERR("Could not create buffer from pool");
goto err;
}