From 27dae84ed92f1ef0300263091972338d12e78348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 18 Oct 2025 19:06:52 +0200 Subject: New upstream version 1.4.1 --- tests/test-fstat.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'tests/test-fstat.c') diff --git a/tests/test-fstat.c b/tests/test-fstat.c index 3af63136..2fda6963 100644 --- a/tests/test-fstat.c +++ b/tests/test-fstat.c @@ -1,5 +1,5 @@ /* Tests of fstat() function. - Copyright (C) 2011-2024 Free Software Foundation, Inc. + Copyright (C) 2011-2025 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,6 +22,7 @@ SIGNATURE_CHECK (fstat, int, (int, struct stat *)); #include +#include #include #include "macros.h" @@ -46,5 +47,17 @@ main () ASSERT (errno == EBADF); } + /* /dev/null is a character device. */ + { + int fd; + struct stat statbuf; + + fd = open ("/dev/null", O_RDWR); + ASSERT (fstat (fd, &statbuf) == 0); + close (fd); + ASSERT (!S_ISREG (statbuf.st_mode)); + ASSERT (S_ISCHR (statbuf.st_mode)); + } + return test_exit_status; } -- cgit v1.2.3