log: move log_warning to log_warn
log_warn is much shorter and we already use log_err instead of log_error so this is more consistent now. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
parent
8e6803ed0a
commit
bd09f38a4d
@ -467,7 +467,7 @@ void kmscon_buffer_draw(struct kmscon_buffer *buf, struct kmscon_font *font)
|
||||
|
||||
m = kmscon_m4_stack_push(buf->stack);
|
||||
if (!m) {
|
||||
log_warning("console: cannot push matrix\n");
|
||||
log_warn("console: cannot push matrix\n");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -504,7 +504,7 @@ void kmscon_buffer_write(struct kmscon_buffer *buf, unsigned int x,
|
||||
return;
|
||||
|
||||
if (x >= buf->size_x || y >= buf->size_y) {
|
||||
log_warning("console: writing beyond buffer boundary\n");
|
||||
log_warn("console: writing beyond buffer boundary\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -512,7 +512,7 @@ void kmscon_buffer_write(struct kmscon_buffer *buf, unsigned int x,
|
||||
while (buf->fill <= y) {
|
||||
ret = new_line(&line);
|
||||
if (ret) {
|
||||
log_warning("console: cannot allocate line "
|
||||
log_warn("console: cannot allocate line "
|
||||
"(%d); dropping input\n", ret);
|
||||
return;
|
||||
}
|
||||
@ -525,7 +525,7 @@ void kmscon_buffer_write(struct kmscon_buffer *buf, unsigned int x,
|
||||
if (x >= line->size) {
|
||||
ret = resize_line(line, buf->size_x);
|
||||
if (ret) {
|
||||
log_warning("console: cannot resize line (%d); "
|
||||
log_warn("console: cannot resize line (%d); "
|
||||
"dropping input\n", ret);
|
||||
return;
|
||||
}
|
||||
@ -543,7 +543,7 @@ kmscon_symbol_t kmscon_buffer_read(struct kmscon_buffer *buf, unsigned int x,
|
||||
return kmscon_symbol_default;
|
||||
|
||||
if (x >= buf->size_x || y >= buf->size_y) {
|
||||
log_warning("console: reading out of buffer bounds\n");
|
||||
log_warn("console: reading out of buffer bounds\n");
|
||||
return kmscon_symbol_default;
|
||||
}
|
||||
|
||||
@ -567,7 +567,7 @@ void kmscon_buffer_rotate(struct kmscon_buffer *buf)
|
||||
|
||||
ret = new_line(&nl);
|
||||
if (ret) {
|
||||
log_warning("console: cannot allocate line (%d); "
|
||||
log_warn("console: cannot allocate line (%d); "
|
||||
"dropping input\n", ret);
|
||||
return;
|
||||
}
|
||||
|
@ -421,7 +421,7 @@ static void signal_cb(struct kmscon_fd *fd, int mask, void *data)
|
||||
if (mask & KMSCON_READABLE) {
|
||||
len = read(fd->fd, &signal_info, sizeof(signal_info));
|
||||
if (len != sizeof(signal_info))
|
||||
log_warning("eloop: cannot read signalfd\n");
|
||||
log_warn("eloop: cannot read signalfd\n");
|
||||
else
|
||||
sig->cb(sig, signal_info.ssi_signo, sig->data);
|
||||
}
|
||||
@ -545,7 +545,7 @@ int kmscon_eloop_dispatch(struct kmscon_eloop *loop, int timeout)
|
||||
/* dispatch fd events */
|
||||
count = epoll_wait(loop->efd, ep, 32, timeout);
|
||||
if (count < 0) {
|
||||
log_warning("eloop: epoll_wait dispatching failed: %m\n");
|
||||
log_warn("eloop: epoll_wait dispatching failed: %m\n");
|
||||
return -errno;
|
||||
}
|
||||
|
||||
|
@ -193,7 +193,7 @@ int kmscon_font_factory_new(struct kmscon_font_factory **out,
|
||||
|
||||
err = FT_Init_FreeType(&ff->lib);
|
||||
if (err) {
|
||||
log_warning("font: cannot initialize FreeType library\n");
|
||||
log_warn("font: cannot initialize FreeType library\n");
|
||||
ret = -EFAULT;
|
||||
goto err_free;
|
||||
}
|
||||
@ -231,7 +231,7 @@ void kmscon_font_factory_unref(struct kmscon_font_factory *ff)
|
||||
|
||||
err = FT_Done_FreeType(ff->lib);
|
||||
if (err)
|
||||
log_warning("font: cannot deinitialize FreeType library\n");
|
||||
log_warn("font: cannot deinitialize FreeType library\n");
|
||||
|
||||
kmscon_compositor_unref(ff->comp);
|
||||
kmscon_symbol_table_unref(ff->st);
|
||||
@ -270,20 +270,20 @@ int kmscon_font_factory_load(struct kmscon_font_factory *ff,
|
||||
if (err == FT_Err_Unknown_File_Format)
|
||||
estr = "unknown file format";
|
||||
|
||||
log_warning("font: cannot load font: %s\n", estr);
|
||||
log_warn("font: cannot load font: %s\n", estr);
|
||||
ret = -EFAULT;
|
||||
goto err_free;
|
||||
}
|
||||
|
||||
if (!font->face->charmap) {
|
||||
log_warning("font: cannot load charmap of new font\n");
|
||||
log_warn("font: cannot load charmap of new font\n");
|
||||
ret = -EFAULT;
|
||||
goto err_face;
|
||||
}
|
||||
|
||||
err = FT_Set_Pixel_Sizes(font->face, width, height);
|
||||
if (err) {
|
||||
log_warning("font: cannot set pixel size of font\n");
|
||||
log_warn("font: cannot set pixel size of font\n");
|
||||
ret = -EFAULT;
|
||||
goto err_face;
|
||||
}
|
||||
|
32
src/input.c
32
src/input.c
@ -123,14 +123,14 @@ static void device_data_arrived(struct kmscon_fd *fd, int mask, void *data)
|
||||
if (errno == EWOULDBLOCK)
|
||||
break;
|
||||
|
||||
log_warning("input: reading device %s failed %d\n",
|
||||
log_warn("input: reading device %s failed %d\n",
|
||||
device->devnode, errno);
|
||||
remove_device(input, device->devnode);
|
||||
} else if (len == 0) {
|
||||
log_debug("input: EOF device %s\n", device->devnode);
|
||||
remove_device(input, device->devnode);
|
||||
} else if (len % sizeof(*ev)) {
|
||||
log_warning("input: read invalid input_event\n");
|
||||
log_warn("input: read invalid input_event\n");
|
||||
} else {
|
||||
n = len / sizeof(*ev);
|
||||
for (i = 0; i < n; i++)
|
||||
@ -152,7 +152,7 @@ int kmscon_input_device_wake_up(struct kmscon_input_device *device)
|
||||
|
||||
device->rfd = open(device->devnode, O_CLOEXEC | O_NONBLOCK | O_RDONLY);
|
||||
if (device->rfd < 0) {
|
||||
log_warning("input: cannot open input device %s: %d\n",
|
||||
log_warn("input: cannot open input device %s: %d\n",
|
||||
device->devnode, errno);
|
||||
return -errno;
|
||||
}
|
||||
@ -272,20 +272,20 @@ int kmscon_input_new(struct kmscon_input **out)
|
||||
|
||||
ret = kmscon_kbd_desc_new(&input->desc, layout, variant, options);
|
||||
if (ret) {
|
||||
log_warning("input: cannot create xkb description\n");
|
||||
log_warn("input: cannot create xkb description\n");
|
||||
goto err_free;
|
||||
}
|
||||
|
||||
input->udev = udev_new();
|
||||
if (!input->udev) {
|
||||
log_warning("input: cannot create udev object\n");
|
||||
log_warn("input: cannot create udev object\n");
|
||||
ret = -EFAULT;
|
||||
goto err_xkb;
|
||||
}
|
||||
|
||||
input->monitor = udev_monitor_new_from_netlink(input->udev, "udev");
|
||||
if (!input->monitor) {
|
||||
log_warning("input: cannot create udev monitor\n");
|
||||
log_warn("input: cannot create udev monitor\n");
|
||||
ret = -EFAULT;
|
||||
goto err_udev;
|
||||
}
|
||||
@ -293,14 +293,14 @@ int kmscon_input_new(struct kmscon_input **out)
|
||||
ret = udev_monitor_filter_add_match_subsystem_devtype(input->monitor,
|
||||
"input", NULL);
|
||||
if (ret) {
|
||||
log_warning("input: cannot add udev filter\n");
|
||||
log_warn("input: cannot add udev filter\n");
|
||||
ret = -EFAULT;
|
||||
goto err_monitor;
|
||||
}
|
||||
|
||||
ret = udev_monitor_enable_receiving(input->monitor);
|
||||
if (ret) {
|
||||
log_warning("input: cannot start udev monitor\n");
|
||||
log_warn("input: cannot start udev monitor\n");
|
||||
ret = -EFAULT;
|
||||
goto err_monitor;
|
||||
}
|
||||
@ -372,7 +372,7 @@ static void add_device(struct kmscon_input *input,
|
||||
|
||||
ret = kmscon_input_device_new(&device, input, node);
|
||||
if (ret) {
|
||||
log_warning("input: cannot create input device for %s\n",
|
||||
log_warn("input: cannot create input device for %s\n",
|
||||
node);
|
||||
return;
|
||||
}
|
||||
@ -380,7 +380,7 @@ static void add_device(struct kmscon_input *input,
|
||||
if (input->state == INPUT_AWAKE) {
|
||||
ret = kmscon_input_device_wake_up(device);
|
||||
if (ret) {
|
||||
log_warning("input: cannot wake up new device %s\n",
|
||||
log_warn("input: cannot wake up new device %s\n",
|
||||
node);
|
||||
kmscon_input_device_unref(device);
|
||||
return;
|
||||
@ -446,7 +446,7 @@ static void device_changed(struct kmscon_fd *fd, int mask, void *data)
|
||||
|
||||
action = udev_device_get_action(udev_device);
|
||||
if (!action) {
|
||||
log_warning("input: cannot get action field of new device\n");
|
||||
log_warn("input: cannot get action field of new device\n");
|
||||
goto err_device;
|
||||
}
|
||||
|
||||
@ -470,19 +470,19 @@ static void add_initial_devices(struct kmscon_input *input)
|
||||
|
||||
e = udev_enumerate_new(input->udev);
|
||||
if (!e) {
|
||||
log_warning("input: cannot create udev enumeration\n");
|
||||
log_warn("input: cannot create udev enumeration\n");
|
||||
return;
|
||||
}
|
||||
|
||||
ret = udev_enumerate_add_match_subsystem(e, "input");
|
||||
if (ret) {
|
||||
log_warning("input: cannot add match to udev enumeration\n");
|
||||
log_warn("input: cannot add match to udev enumeration\n");
|
||||
goto err_enum;
|
||||
}
|
||||
|
||||
ret = udev_enumerate_scan_devices(e);
|
||||
if (ret) {
|
||||
log_warning("input: cannot scan udev enumeration\n");
|
||||
log_warn("input: cannot scan udev enumeration\n");
|
||||
goto err_enum;
|
||||
}
|
||||
|
||||
@ -494,7 +494,7 @@ static void add_initial_devices(struct kmscon_input *input)
|
||||
|
||||
udev_device = udev_device_new_from_syspath(input->udev, syspath);
|
||||
if (!udev_device) {
|
||||
log_warning("input: cannot create device "
|
||||
log_warn("input: cannot create device "
|
||||
"from udev path\n");
|
||||
continue;
|
||||
}
|
||||
@ -591,7 +591,7 @@ void kmscon_input_wake_up(struct kmscon_input *input)
|
||||
tmp = iter;
|
||||
iter = iter->next;
|
||||
|
||||
log_warning("input: device %s does not wake up, "
|
||||
log_warn("input: device %s does not wake up, "
|
||||
"removing device\n", tmp->devnode);
|
||||
kmscon_input_device_unref(tmp);
|
||||
} else {
|
||||
|
@ -597,7 +597,7 @@ void kmscon_kbd_reset(struct kmscon_kbd *kbd, int evdev_fd)
|
||||
errno = 0;
|
||||
ioctl(evdev_fd, EVIOCGLED(sizeof(leds)), &leds);
|
||||
if (errno) {
|
||||
log_warning("kbd-xkb: cannot discover modifiers state: %m\n");
|
||||
log_warn("kbd-xkb: cannot discover modifiers state: %m\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
/* LOG_EMERG and LOG_ALERT do not make sense for this application */
|
||||
#define LOG_CRIT "<2>" /* error that cannot be handled correctly */
|
||||
#define LOG_ERR "<3>" /* error detected */
|
||||
#define LOG_WARNING "<4>" /* warn about unexpected conditions */
|
||||
#define LOG_WARN "<4>" /* warn about unexpected conditions */
|
||||
#define LOG_NOTICE "<5>" /* notify about unusual conditions */
|
||||
#define LOG_INFO "<6>" /* basic inforomational messages */
|
||||
#define LOG_DEBUG "<7>" /* debug messages */
|
||||
@ -61,7 +61,7 @@ void log_vprintf(const char *format, va_list list);
|
||||
|
||||
#define log_crit(format, ...) log_printf(LOG_CRIT format, ##__VA_ARGS__)
|
||||
#define log_err(format, ...) log_printf(LOG_ERR format, ##__VA_ARGS__)
|
||||
#define log_warning(format, ...) log_printf(LOG_WARNING format, ##__VA_ARGS__)
|
||||
#define log_warn(format, ...) log_printf(LOG_WARN format, ##__VA_ARGS__)
|
||||
#define log_notice(format, ...) log_printf(LOG_NOTICE format, ##__VA_ARGS__)
|
||||
#define log_info(format, ...) log_printf(LOG_INFO format, ##__VA_ARGS__)
|
||||
|
||||
|
18
src/output.c
18
src/output.c
@ -450,7 +450,7 @@ static int kmscon_output_connect(struct kmscon_output *output, drmModeRes *res,
|
||||
}
|
||||
|
||||
if (crtc < 0) {
|
||||
log_warning("output: no free CRTC left to connect output\n");
|
||||
log_warn("output: no free CRTC left to connect output\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -471,7 +471,7 @@ static int kmscon_output_connect(struct kmscon_output *output, drmModeRes *res,
|
||||
}
|
||||
|
||||
if (!output->count_modes) {
|
||||
log_warning("output: no suitable mode available for output\n");
|
||||
log_warn("output: no suitable mode available for output\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -555,7 +555,7 @@ static int init_rb(struct render_buffer *rb, struct kmscon_compositor *comp,
|
||||
GBM_BO_FORMAT_XRGB8888,
|
||||
GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING);
|
||||
if (!rb->bo) {
|
||||
log_warning("output: cannot create gbm buffer object\n");
|
||||
log_warn("output: cannot create gbm buffer object\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
@ -569,7 +569,7 @@ static int init_rb(struct render_buffer *rb, struct kmscon_compositor *comp,
|
||||
ret = drmModeAddFB(comp->drm_fd, mode->hdisplay, mode->vdisplay,
|
||||
24, 32, stride, handle, &rb->fb);
|
||||
if (ret) {
|
||||
log_warning("output: cannot add DRM framebuffer object\n");
|
||||
log_warn("output: cannot add DRM framebuffer object\n");
|
||||
ret = -EFAULT;
|
||||
goto err_bo;
|
||||
}
|
||||
@ -756,7 +756,7 @@ int kmscon_output_swap(struct kmscon_output *output)
|
||||
output->rb[num].fb, 0, 0, &output->conn_id, 1,
|
||||
&output->current->info);
|
||||
if (ret) {
|
||||
log_warning("output: cannot set CRTC\n");
|
||||
log_warn("output: cannot set CRTC\n");
|
||||
ret = -EFAULT;
|
||||
}
|
||||
|
||||
@ -793,14 +793,14 @@ int kmscon_compositor_new(struct kmscon_compositor **out)
|
||||
/* TODO: Retrieve this path dynamically */
|
||||
comp->drm_fd = open("/dev/dri/card0", O_RDWR | O_CLOEXEC);
|
||||
if (comp->drm_fd < 0) {
|
||||
log_warning("output: cannot open /dev/dri/card0: %m\n");
|
||||
log_warn("output: cannot open /dev/dri/card0: %m\n");
|
||||
ret = -errno;
|
||||
goto err_free;
|
||||
}
|
||||
|
||||
comp->gbm = gbm_create_device(comp->drm_fd);
|
||||
if (!comp->gbm) {
|
||||
log_warning("output: cannot allocate gbm device\n");
|
||||
log_warn("output: cannot allocate gbm device\n");
|
||||
ret = -EFAULT;
|
||||
goto err_drm;
|
||||
}
|
||||
@ -888,7 +888,7 @@ int kmscon_compositor_wake_up(struct kmscon_compositor *comp)
|
||||
|
||||
ret = drmSetMaster(comp->drm_fd);
|
||||
if (ret) {
|
||||
log_warning("output: cannot acquire DRM master privs\n");
|
||||
log_warn("output: cannot acquire DRM master privs\n");
|
||||
return -EACCES;
|
||||
}
|
||||
|
||||
@ -1026,7 +1026,7 @@ int kmscon_compositor_refresh(struct kmscon_compositor *comp)
|
||||
|
||||
res = drmModeGetResources(comp->drm_fd);
|
||||
if (!res) {
|
||||
log_warning("output: cannot retrieve DRM resources\n");
|
||||
log_warn("output: cannot retrieve DRM resources\n");
|
||||
return -EACCES;
|
||||
}
|
||||
|
||||
|
@ -209,7 +209,7 @@ static int compile_shader(struct kmscon_context *ctx, GLenum type,
|
||||
|
||||
s = ctx->proc_create_shader(type);
|
||||
if (s == GL_NONE) {
|
||||
log_warning("context: cannot allocate GL shader\n");
|
||||
log_warn("context: cannot allocate GL shader\n");
|
||||
return GL_NONE;
|
||||
}
|
||||
|
||||
@ -220,7 +220,7 @@ static int compile_shader(struct kmscon_context *ctx, GLenum type,
|
||||
if (status == GL_FALSE) {
|
||||
msg[0] = 0;
|
||||
ctx->proc_get_shader_info_log(s, sizeof(msg), NULL, msg);
|
||||
log_warning("context: cannot compile shader: %s\n", msg);
|
||||
log_warn("context: cannot compile shader: %s\n", msg);
|
||||
return GL_NONE;
|
||||
}
|
||||
|
||||
@ -260,7 +260,7 @@ static int init_def_shader(struct kmscon_context *ctx)
|
||||
msg[0] = 0;
|
||||
ctx->proc_get_program_info_log(ctx->def_program, sizeof(msg),
|
||||
NULL, msg);
|
||||
log_warning("context: cannot link shader: %s\n", msg);
|
||||
log_warn("context: cannot link shader: %s\n", msg);
|
||||
ret = -EFAULT;
|
||||
goto err_link;
|
||||
}
|
||||
@ -311,7 +311,7 @@ static int init_tex_shader(struct kmscon_context *ctx)
|
||||
msg[0] = 0;
|
||||
ctx->proc_get_program_info_log(ctx->tex_program, sizeof(msg),
|
||||
NULL, msg);
|
||||
log_warning("context: cannot link shader: %s\n", msg);
|
||||
log_warn("context: cannot link shader: %s\n", msg);
|
||||
ret = -EFAULT;
|
||||
goto err_link;
|
||||
}
|
||||
@ -398,21 +398,21 @@ int kmscon_context_new(struct kmscon_context **out, void *gbm)
|
||||
|
||||
ctx->display = eglGetDisplay((EGLNativeDisplayType) gbm);
|
||||
if (!ctx->display) {
|
||||
log_warning("context: cannot get EGL display\n");
|
||||
log_warn("context: cannot get EGL display\n");
|
||||
ret = -EFAULT;
|
||||
goto err_free;
|
||||
}
|
||||
|
||||
ret = eglInitialize(ctx->display, &major, &minor);
|
||||
if (!ret) {
|
||||
log_warning("context: cannot initialize EGL display\n");
|
||||
log_warn("context: cannot initialize EGL display\n");
|
||||
ret = -EFAULT;
|
||||
goto err_free;
|
||||
}
|
||||
|
||||
ext = eglQueryString(ctx->display, EGL_EXTENSIONS);
|
||||
if (!ext || !strstr(ext, "EGL_KHR_surfaceless_opengl")) {
|
||||
log_warning("context: surfaceless EGL not supported\n");
|
||||
log_warn("context: surfaceless EGL not supported\n");
|
||||
ret = -ENOTSUP;
|
||||
goto err_display;
|
||||
}
|
||||
@ -424,7 +424,7 @@ int kmscon_context_new(struct kmscon_context **out, void *gbm)
|
||||
#endif
|
||||
|
||||
if (!eglBindAPI(api)) {
|
||||
log_warning("context: cannot bind EGL OpenGL API\n");
|
||||
log_warn("context: cannot bind EGL OpenGL API\n");
|
||||
ret = -EFAULT;
|
||||
goto err_display;
|
||||
}
|
||||
@ -432,14 +432,14 @@ int kmscon_context_new(struct kmscon_context **out, void *gbm)
|
||||
ctx->context = eglCreateContext(ctx->display, NULL, EGL_NO_CONTEXT,
|
||||
ctx_attribs);
|
||||
if (!ctx->context) {
|
||||
log_warning("context: cannot create EGL context\n");
|
||||
log_warn("context: cannot create EGL context\n");
|
||||
ret = -EFAULT;
|
||||
goto err_display;
|
||||
}
|
||||
|
||||
if (!eglMakeCurrent(ctx->display, EGL_NO_SURFACE, EGL_NO_SURFACE,
|
||||
ctx->context)) {
|
||||
log_warning("context: cannot use EGL context\n");
|
||||
log_warn("context: cannot use EGL context\n");
|
||||
ret = -EFAULT;
|
||||
goto err_ctx;
|
||||
}
|
||||
@ -511,7 +511,7 @@ int kmscon_context_new(struct kmscon_context **out, void *gbm)
|
||||
|
||||
if (!ctx->proc_rbuf_storage || !ctx->proc_create_image ||
|
||||
!ctx->proc_destroy_image) {
|
||||
log_warning("context: KHR images not supported\n");
|
||||
log_warn("context: KHR images not supported\n");
|
||||
ret = -ENOTSUP;
|
||||
goto err_ctx;
|
||||
} else if (!ctx->proc_gen_renderbuffers ||
|
||||
@ -519,7 +519,7 @@ int kmscon_context_new(struct kmscon_context **out, void *gbm)
|
||||
!ctx->proc_delete_renderbuffers ||
|
||||
!ctx->proc_framebuffer_renderbuffer ||
|
||||
!ctx->proc_check_framebuffer_status) {
|
||||
log_warning("context: renderbuffers not supported\n");
|
||||
log_warn("context: renderbuffers not supported\n");
|
||||
ret = -ENOTSUP;
|
||||
goto err_ctx;
|
||||
} else if (!ctx->proc_create_shader ||
|
||||
@ -528,7 +528,7 @@ int kmscon_context_new(struct kmscon_context **out, void *gbm)
|
||||
!ctx->proc_compile_shader ||
|
||||
!ctx->proc_get_shader_iv ||
|
||||
!ctx->proc_get_shader_info_log) {
|
||||
log_warning("context: shaders not supported\n");
|
||||
log_warn("context: shaders not supported\n");
|
||||
ret = -ENOTSUP;
|
||||
goto err_ctx;
|
||||
} else if (!ctx->proc_create_program ||
|
||||
@ -545,7 +545,7 @@ int kmscon_context_new(struct kmscon_context **out, void *gbm)
|
||||
!ctx->proc_vertex_attrib_pointer ||
|
||||
!ctx->proc_enable_vertex_attrib_array ||
|
||||
!ctx->proc_draw_arrays) {
|
||||
log_warning("context: shaders not supported\n");
|
||||
log_warn("context: shaders not supported\n");
|
||||
ret = -ENOTSUP;
|
||||
goto err_ctx;
|
||||
}
|
||||
@ -588,7 +588,7 @@ int kmscon_context_use(struct kmscon_context *ctx)
|
||||
|
||||
if (!eglMakeCurrent(ctx->display, EGL_NO_SURFACE, EGL_NO_SURFACE,
|
||||
ctx->context)) {
|
||||
log_warning("context: cannot use EGL context\n");
|
||||
log_warn("context: cannot use EGL context\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
@ -735,7 +735,7 @@ int renderbuffer_new(struct renderbuffer **out, struct kmscon_context *ctx,
|
||||
rb->image = ctx->proc_create_image(ctx->display, NULL,
|
||||
EGL_NATIVE_PIXMAP_KHR, bo, NULL);
|
||||
if (!rb->image) {
|
||||
log_warning("context: cannot create EGL image\n");
|
||||
log_warn("context: cannot create EGL image\n");
|
||||
ret = -EFAULT;
|
||||
goto err_free;
|
||||
}
|
||||
@ -745,7 +745,7 @@ int renderbuffer_new(struct renderbuffer **out, struct kmscon_context *ctx,
|
||||
ctx->proc_rbuf_storage(GL_RENDERBUFFER, rb->image);
|
||||
|
||||
if (has_gl_error()) {
|
||||
log_warning("context: cannot create renderbuffers\n");
|
||||
log_warn("context: cannot create renderbuffers\n");
|
||||
ret = -EFAULT;
|
||||
goto err_gl;
|
||||
}
|
||||
@ -804,7 +804,7 @@ int kmscon_framebuffer_new(struct kmscon_framebuffer **out,
|
||||
|
||||
if (ctx->proc_check_framebuffer_status(GL_FRAMEBUFFER) !=
|
||||
GL_FRAMEBUFFER_COMPLETE) {
|
||||
log_warning("context: invalid GL framebuffer state\n");
|
||||
log_warn("context: invalid GL framebuffer state\n");
|
||||
ret = -EFAULT;
|
||||
goto err_fb;
|
||||
}
|
||||
@ -856,7 +856,7 @@ int kmscon_framebuffer_swap(struct kmscon_framebuffer *fb)
|
||||
|
||||
if (fb->ctx->proc_check_framebuffer_status(GL_FRAMEBUFFER) !=
|
||||
GL_FRAMEBUFFER_COMPLETE)
|
||||
log_warning("context: invalid GL framebuffer state\n");
|
||||
log_warn("context: invalid GL framebuffer state\n");
|
||||
|
||||
return fb->current_rb;
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ static int fork_pty_child(int master, struct winsize *ws)
|
||||
if (ws) {
|
||||
ret = ioctl(slave, TIOCSWINSZ, ws);
|
||||
if (ret)
|
||||
log_warning("pty: cannot set slave window size: %m");
|
||||
log_warn("pty: cannot set slave window size: %m");
|
||||
}
|
||||
|
||||
if (dup2(slave, STDIN_FILENO) != STDIN_FILENO ||
|
||||
@ -269,14 +269,14 @@ static void pty_output(struct kmscon_fd *fd, int mask, void *data)
|
||||
*/
|
||||
if (!(mask & KMSCON_READABLE)) {
|
||||
if (mask & KMSCON_ERR)
|
||||
log_warning("pty: error condition happened on pty\n");
|
||||
log_warn("pty: error condition happened on pty\n");
|
||||
kmscon_pty_close(pty);
|
||||
return;
|
||||
}
|
||||
|
||||
ret = ioctl(pty->fd, FIONREAD, &nread);
|
||||
if (ret) {
|
||||
log_warning("pty: cannot peek into pty input buffer: %m");
|
||||
log_warn("pty: cannot peek into pty input buffer: %m");
|
||||
return;
|
||||
} else if (nread <= 0) {
|
||||
return;
|
||||
@ -413,7 +413,7 @@ void kmscon_pty_resize(struct kmscon_pty *pty,
|
||||
*/
|
||||
ret = ioctl(pty->fd, TIOCSWINSZ, &ws);
|
||||
if (ret) {
|
||||
log_warning("pty: cannot set window size\n");
|
||||
log_warn("pty: cannot set window size\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ static void schedule_redraw(struct kmscon_terminal *term)
|
||||
|
||||
ret = kmscon_eloop_add_idle(term->eloop, term->redraw, draw_all, term);
|
||||
if (ret && ret != -EALREADY)
|
||||
log_warning("terminal: cannot schedule redraw\n");
|
||||
log_warn("terminal: cannot schedule redraw\n");
|
||||
}
|
||||
|
||||
static void pty_output(struct kmscon_pty *pty, char *u8, size_t len, void *data)
|
||||
@ -291,7 +291,7 @@ int kmscon_terminal_add_output(struct kmscon_terminal *term,
|
||||
|
||||
mode = kmscon_output_get_current(output);
|
||||
if (!mode) {
|
||||
log_warning("terminal: invalid output added to terminal\n");
|
||||
log_warn("terminal: invalid output added to terminal\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -165,7 +165,7 @@ void kmscon_symbol_table_unref(struct kmscon_symbol_table *st)
|
||||
kmscon_symbol_t kmscon_symbol_make(uint32_t ucs4)
|
||||
{
|
||||
if (ucs4 > KMSCON_UCS4_MAX) {
|
||||
log_warning("unicode: invalid ucs4 character\n");
|
||||
log_warn("unicode: invalid ucs4 character\n");
|
||||
return 0;
|
||||
} else {
|
||||
return ucs4;
|
||||
@ -183,7 +183,7 @@ kmscon_symbol_t kmscon_symbol_append(struct kmscon_symbol_table *st,
|
||||
return sym;
|
||||
|
||||
if (ucs4 > KMSCON_UCS4_MAX) {
|
||||
log_warning("unicode: invalid ucs4 character\n");
|
||||
log_warn("unicode: invalid ucs4 character\n");
|
||||
return sym;
|
||||
}
|
||||
|
||||
|
14
src/vt.c
14
src/vt.c
@ -146,7 +146,7 @@ static void vt_enter(struct kmscon_signal *sig, int signum, void *data)
|
||||
ioctl(vt->fd, VT_RELDISP, VT_ACKACQ);
|
||||
|
||||
if (ioctl(vt->fd, KDSETMODE, KD_GRAPHICS))
|
||||
log_warning("vt: cannot set graphics mode on vt\n");
|
||||
log_warn("vt: cannot set graphics mode on vt\n");
|
||||
|
||||
if (vt->cb)
|
||||
vt->cb(vt, KMSCON_VT_ENTER, vt->data);
|
||||
@ -166,7 +166,7 @@ static void vt_leave(struct kmscon_signal *sig, int signum, void *data)
|
||||
log_debug("vt: leaving VT\n");
|
||||
ioctl(vt->fd, VT_RELDISP, 1);
|
||||
if (ioctl(vt->fd, KDSETMODE, KD_TEXT))
|
||||
log_warning("vt: cannot set text mode on vt\n");
|
||||
log_warn("vt: cannot set text mode on vt\n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -292,7 +292,7 @@ int kmscon_vt_open(struct kmscon_vt *vt, int id, struct kmscon_eloop *eloop)
|
||||
*/
|
||||
ret = ioctl(vt->fd, VT_GETSTATE, &vts);
|
||||
if (ret) {
|
||||
log_warning("vt: cannot find the current VT\n");
|
||||
log_warn("vt: cannot find the current VT\n");
|
||||
vt->saved_num = -1;
|
||||
} else {
|
||||
vt->saved_num = vts.v_active;
|
||||
@ -312,7 +312,7 @@ int kmscon_vt_open(struct kmscon_vt *vt, int id, struct kmscon_eloop *eloop)
|
||||
raw_attribs.c_oflag |= OPOST | OCRNL;
|
||||
|
||||
if (tcsetattr(vt->fd, TCSANOW, &raw_attribs) < 0)
|
||||
log_warning("vt: cannot put terminal into raw mode\n");
|
||||
log_warn("vt: cannot put terminal into raw mode\n");
|
||||
|
||||
if (ioctl(vt->fd, KDSETMODE, KD_GRAPHICS)) {
|
||||
log_err("vt: cannot set graphics mode\n");
|
||||
@ -375,7 +375,7 @@ int kmscon_vt_enter(struct kmscon_vt *vt)
|
||||
|
||||
ret = ioctl(vt->fd, VT_ACTIVATE, vt->num);
|
||||
if (ret) {
|
||||
log_warning("vt: cannot enter VT\n");
|
||||
log_warn("vt: cannot enter VT\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
@ -407,7 +407,7 @@ int kmscon_vt_leave(struct kmscon_vt *vt)
|
||||
|
||||
ret = ioctl(vt->fd, VT_GETSTATE, &vts);
|
||||
if (ret) {
|
||||
log_warning("vt: cannot find current VT\n");
|
||||
log_warn("vt: cannot find current VT\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
@ -416,7 +416,7 @@ int kmscon_vt_leave(struct kmscon_vt *vt)
|
||||
|
||||
ret = ioctl(vt->fd, VT_ACTIVATE, vt->saved_num);
|
||||
if (ret) {
|
||||
log_warning("vt: cannot leave VT\n");
|
||||
log_warn("vt: cannot leave VT\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
|
@ -152,7 +152,7 @@ static void schedule_draw(struct console *con)
|
||||
|
||||
ret = kmscon_eloop_add_idle(con->loop, con->idle, draw, con);
|
||||
if (ret && ret != -EALREADY)
|
||||
log_warning("Cannot schedule draw function\n");
|
||||
log_warn("Cannot schedule draw function\n");
|
||||
}
|
||||
|
||||
static void activate_outputs(struct console *con)
|
||||
|
@ -78,7 +78,7 @@ static void sig_chld(struct kmscon_signal *sig, int signum, void *data)
|
||||
pid = waitpid(-1, &status, WNOHANG);
|
||||
if (pid == -1) {
|
||||
if (errno != ECHILD)
|
||||
log_warning("test: cannot wait on child: %m\n");
|
||||
log_warn("test: cannot wait on child: %m\n");
|
||||
break;
|
||||
} else if (pid == 0) {
|
||||
break;
|
||||
|
@ -84,7 +84,7 @@ int main(int argc, char **argv)
|
||||
|
||||
ret = kmscon_vt_enter(vt);
|
||||
if (ret)
|
||||
log_warning("Cannot switch to VT\n");
|
||||
log_warn("Cannot switch to VT\n");
|
||||
|
||||
while (!terminate) {
|
||||
ret = kmscon_eloop_dispatch(loop, -1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user