From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 2/2] shell lib: Add support for test cleanup
Date: Mon, 17 Feb 2025 08:44:13 +0100 [thread overview]
Message-ID: <20250217074413.GA2350499@pevik> (raw)
In-Reply-To: <20250214112135.18947-3-chrubis@suse.cz>
Hi Cyril,
could we get check for file existence, the same way it's done in metaparse.c?
Also, I'd prefer if both tools exit 1 in case of missing file (so that CI
notifies the problem).
Kind regards,
Petr
+++ metadata/metaparse-sh.c
@@ -6,6 +6,7 @@
#include <stdio.h>
#include <string.h>
#include <libgen.h>
+#include <unistd.h>
#include "data_storage.h"
@@ -46,6 +47,11 @@ static void parse_shell(char *path)
FILE *f = fopen(path, "r");
enum state state = NONE;
+ if (access(path, F_OK)) {
+ fprintf(stderr, "file %s does not exist\n", path);
+ return;
+ }
+
while (fgets(line, sizeof(line), f)) {
/* Strip newline */
line[strlen(line)-1] = 0;
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-02-17 7:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-14 11:21 [LTP] [PATCH 0/2] shell lib: Add very simple cleanup support Cyril Hrubis
2025-02-14 11:21 ` [LTP] [PATCH 1/2] testcases/lib/run_tests.sh Cyril Hrubis
2025-02-14 13:37 ` Petr Vorel
2025-02-28 11:49 ` Petr Vorel
2025-02-14 11:21 ` [LTP] [PATCH 2/2] shell lib: Add support for test cleanup Cyril Hrubis
2025-02-14 13:55 ` Petr Vorel
2025-02-14 14:07 ` Cyril Hrubis
2025-02-14 14:18 ` Cyril Hrubis
2025-02-17 7:44 ` Petr Vorel [this message]
2025-02-25 10:25 ` Cyril Hrubis
2025-02-25 11:00 ` Petr Vorel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250217074413.GA2350499@pevik \
--to=pvorel@suse.cz \
--cc=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.