igt_core: Fix logging to display extended line
PATCH 1/1 igt_core: Fix logging to display extended line
line[strlen(line)] will always evaluate to NULL so line_continuation was always true. That prevented the program name, pid and log level ever being printed.
Changed to [strlen(line) - 1] so the last character before the null terminator is compared with '\n' to determine line_continuation.
Signed-off-by Derek Morton <[email protected]>
--- lib/igt_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/igt_core.c +1 -1
@@ -1748,7 +1748,7 @@ void igt_vlog(const char *domain, enum igt_log_level level, const char *format, goto out; } - line_continuation = line[strlen (line)] !='\n' ; + line_continuation = line[strlen (line) -1 ] !='\n' ;/* append log buffer */ _igt_log_buffer_append (formatted_line);
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 7 lines · Derek Morton
line[strlen(line)] will always evaluate to NULL so
line_continuationwas always true. That prevented the program name, pid and log level ever being printed.
Changed to [strlen(line) - 1] so the last character before the null terminator is compared with '\n' to determineline_continuation.Signed-off-by Derek Morton <[email protected]>
Ooops. Applied, thanks for the patch.
-Daniel
Quoted 24 lines
--- lib/igt_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/igt_core.c +1
-1@@ -1748,7 +1748,7 @@ void igt_vlog(const char *domain, enum igt_log_level level, const char *format, goto out; } - line_continuation = line[strlen (line)] !='\n' ; + line_continuation = line[strlen (line) -1 ] !='\n' ;/* append log buffer */ _igt_log_buffer_append (formatted_line);Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx