Merge branch 'misc-fixes2' into 'master'

Misc fixes

See merge request plymouth/plymouth!25
This commit is contained in:
Hans de Goede 2019-02-23 14:01:45 +00:00
commit 4d2377f708
6 changed files with 28 additions and 9 deletions

View file

@ -476,6 +476,11 @@ ply_boot_splash_show (ply_boot_splash_t *splash,
} else if (splash->mode != PLY_BOOT_SPLASH_MODE_INVALID) {
splash->plugin_interface->hide_splash_screen (splash->plugin,
splash->loop);
if (splash->plugin_interface->on_boot_progress != NULL) {
ply_event_loop_stop_watching_for_timeout (splash->loop,
(ply_event_loop_timeout_handler_t)
ply_boot_splash_update_progress, splash);
}
}
ply_trace ("showing splash screen");
@ -671,9 +676,12 @@ ply_boot_splash_become_idle (ply_boot_splash_t *splash,
{
assert (splash->idle_trigger == NULL);
if (splash->progress != NULL) {
if (splash->plugin_interface->on_boot_progress != NULL &&
splash->progress != NULL) {
ply_progress_set_percentage (splash->progress, 1.0);
ply_boot_splash_update_progress (splash);
splash->plugin_interface->on_boot_progress (splash->plugin,
ply_progress_get_time (splash->progress),
1.0);
}
ply_trace ("telling splash to become idle");

View file

@ -261,11 +261,11 @@ ply_animation_add_frames (ply_animation_t *animation)
number_of_frames = ply_array_get_size (animation->frames);
if (number_of_frames == 0) {
ply_trace ("%s directory had no files starting with %s\n",
ply_trace ("%s directory had no files starting with %s",
animation->image_dir, animation->frames_prefix);
goto out;
} else {
ply_trace ("animation has %d frames\n", number_of_frames);
ply_trace ("animation has %d frames", number_of_frames);
}
load_finished = true;

View file

@ -25,6 +25,7 @@
#include <stdint.h>
#include <string.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>
typedef struct _ply_logger ply_logger_t;
@ -88,11 +89,21 @@ bool ply_logger_is_tracing_enabled (ply_logger_t *logger);
_old_errno = errno; \
if (ply_logger_is_tracing_enabled (logger)) \
{ \
struct timespec timespec = { 0, 0 }; \
char buf[128]; \
clock_gettime (CLOCK_MONOTONIC, &timespec); \
ply_logger_flush (logger); \
snprintf (buf, sizeof(buf), \
"%02d:%02d:%02d.%03d %s:%d:%s", \
(int)(timespec.tv_sec / 3600), \
(int)((timespec.tv_sec / 60) % 60), \
(int)(timespec.tv_sec % 60), \
(int)(timespec.tv_nsec / 1000000), \
__FILE__, __LINE__, __func__); \
errno = _old_errno; \
ply_logger_inject (logger, \
"[%s:%d] %45.45s:" format "\n", \
__FILE__, __LINE__, __func__, ## args); \
"%-75.75s: " format "\n", \
buf, ## args); \
ply_logger_flush (logger); \
errno = _old_errno; \
} \

View file

@ -656,7 +656,7 @@ ply_open_module (const char *module_path)
RTLD_NODELETE | RTLD_NOW | RTLD_LOCAL);
if (handle == NULL) {
ply_trace ("Could not load module \"%s\": %s\n", module_path, dlerror ());
ply_trace ("Could not load module \"%s\": %s", module_path, dlerror ());
if (errno == 0)
errno = ELIBACC;
}

View file

@ -1123,7 +1123,7 @@ load_devices (state_t *state,
static void
quit_splash (state_t *state)
{
ply_trace ("quiting splash");
ply_trace ("quitting splash");
if (state->boot_splash != NULL) {
ply_trace ("freeing splash");
ply_boot_splash_free (state->boot_splash);

View file

@ -1100,7 +1100,7 @@ get_preferred_mode (drmModeConnector *connector)
for (i = 0; i < connector->count_modes; i++)
if (connector->modes[i].type & DRM_MODE_TYPE_PREFERRED) {
ply_trace ("Found preferred mode %dx%d at index %d\n",
ply_trace ("Found preferred mode %dx%d at index %d",
connector->modes[i].hdisplay,
connector->modes[i].vdisplay, i);
return &connector->modes[i];