public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Jinseok Kim <always.starving0@gmail.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/2] close: remove unused headers and fix minor style issues
Date: Mon,  6 Apr 2026 22:30:59 +0900	[thread overview]
Message-ID: <20260406133134.17238-1-always.starving0@gmail.com> (raw)

Remove unused headers (<stdio.h>, <errno.h>, <sys/stat.h>) from close01.c
and (<stdio.h>, <sys/stat.h>) from close02.c.

Also make struct test_case_t static and apply minor style fixes.

Signed-off-by: Jinseok Kim <always.starving0@gmail.com>
---
 testcases/kernel/syscalls/close/close01.c | 6 ++----
 testcases/kernel/syscalls/close/close02.c | 2 --
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/testcases/kernel/syscalls/close/close01.c b/testcases/kernel/syscalls/close/close01.c
index 4e4f107ef..616752595 100644
--- a/testcases/kernel/syscalls/close/close01.c
+++ b/testcases/kernel/syscalls/close/close01.c
@@ -8,10 +8,7 @@
  * Test that closing a file/pipe/socket works correctly.
  */

-#include <stdio.h>
-#include <errno.h>
 #include <fcntl.h>
-#include <sys/stat.h>
 #include "tst_test.h"

 #define FILENAME "close01_testfile"
@@ -24,6 +21,7 @@ static int get_fd_file(void)
 static int get_fd_pipe(void)
 {
 	int pipefildes[2];
+
 	SAFE_PIPE(pipefildes);
 	SAFE_CLOSE(pipefildes[1]);
 	return pipefildes[0];
@@ -34,7 +32,7 @@ static int get_fd_socket(void)
 	return SAFE_SOCKET(AF_INET, SOCK_STREAM, 0);
 }

-struct test_case_t {
+static struct test_case_t {
 	int (*get_fd) ();
 	char *type;
 } tc[] = {
diff --git a/testcases/kernel/syscalls/close/close02.c b/testcases/kernel/syscalls/close/close02.c
index 2016453f8..617c48237 100644
--- a/testcases/kernel/syscalls/close/close02.c
+++ b/testcases/kernel/syscalls/close/close02.c
@@ -8,9 +8,7 @@
  * Call close(-1) and expects it to return EBADF.
  */

-#include <stdio.h>
 #include <errno.h>
-#include <sys/stat.h>
 #include "tst_test.h"

 static void run(void)
--
2.43.0

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

             reply	other threads:[~2026-04-06 13:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-06 13:30 Jinseok Kim [this message]
2026-04-06 13:31 ` [LTP] [PATCH 2/2] close: add test for double close EBADF Jinseok Kim
2026-04-09  8:15   ` Petr Vorel
2026-04-09  8:08 ` [LTP] [PATCH 1/2] close: remove unused headers and fix minor style issues 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=20260406133134.17238-1-always.starving0@gmail.com \
    --to=always.starving0@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox