]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-terminal-util: fix sigsegv when compiled without asserts
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 28 Mar 2019 08:35:26 +0000 (09:35 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 28 Mar 2019 08:45:19 +0000 (09:45 +0100)
I couldn't figure out what is going on here, because LTO inlines everything and
then the backtrace reported a different spot. But when compiled with NDEBUG but
no LTO, it's fairly obvious ;)

C.f. #12008.

src/test/test-terminal-util.c

index f063d1d5604fc7fe8bab8e8f87ad2e5520d38aac..96d92279fbfef4ebffaa34246be45b676d164e45 100644 (file)
@@ -40,7 +40,7 @@ static void test_read_one_char(void) {
 
         log_info("/* %s */", __func__);
 
-        assert(fmkostemp_safe(name, "r+", &file) == 0);
+        assert_se(fmkostemp_safe(name, "r+", &file) == 0);
 
         assert_se(fputs("c\n", file) >= 0);
         rewind(file);