From 018de41aeda6c128325378c29f0706f2f847cdce Mon Sep 17 00:00:00 2001 From: hja Date: Mon, 2 Nov 2026 20:31:33 +0000 Subject: [PATCH] Adapt LTbasic2 pathname checks and enable OpenBSD CI tests --- .github/workflows/build.yml | 8 +++----- Makefile.am | 2 +- tests/LTbasic2.c | 7 ++++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eba63da7..fae3221f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -129,17 +129,15 @@ jobs: export AUTOCONF_VERSION=2.72 export AUTOMAKE_VERSION=1.18 - # autotools path: build only. "make check" additionally fails - # tests/LTbasic2 here with "opened regular file wasn't found"; - # that test is not part of the legacy suite below and is left - # for a separate fix. libtool has to come from packages -- the - # base /usr/bin/libtool is a different program and aclocal + # autotools build and tests. libtool has to come from packages -- + # the base /usr/bin/libtool is a different program and aclocal # cannot find LT_INIT without the package's m4 files. autoreconf -vif mkdir /tmp/build cd /tmp/build "$src"/configure make + make check || { cat test-suite.log; exit 1; } cd "$src" # legacy Configure, the path .builds/openbsd.yml covered diff --git a/Makefile.am b/Makefile.am index 75086ca3..cde55530 100644 --- a/Makefile.am +++ b/Makefile.am @@ -213,7 +213,7 @@ tests_LTunix_CFLAGS = @LSOF_TEST_CFLAGS@ -I$(top_srcdir)/include if INSTALL_LIBLSOF TESTS += tests/LTbasic2 check_PROGRAMS += tests/LTbasic2 -tests_LTbasic2_CFLAGS = -I$(top_srcdir)/include +tests_LTbasic2_CFLAGS = @LSOF_TEST_CFLAGS@ -I$(top_srcdir)/include tests_LTbasic2_LDADD = liblsof.la endif diff --git a/tests/LTbasic2.c b/tests/LTbasic2.c index 6b593ce1..e3f6d0e0 100644 --- a/tests/LTbasic2.c +++ b/tests/LTbasic2.c @@ -119,9 +119,10 @@ int main(int argc, char **argv) { /* check if fd matches */ if (f->fd_num == fd && f->inode == tmp_stat.st_ino && f->dev == tmp_stat.st_dev) { -#ifdef NETBSDV - /* on NetBSD, the file path for new created file may be - * unavailable, skip validation */ +#if defined(LT_DIAL_netbsd) || defined(LT_DIAL_openbsd) + /* OpenBSD cannot report regular-file paths; NetBSD + * may not report paths for newly created files. + * Descriptor, inode, and device must still match. */ fd_found = 1; #else if (f->name && strstr(f->name, "LTbasic2-tmp")) {