From 43a42eeffb032c218e146f0dbae385c98d1054d1 Mon Sep 17 00:00:00 2001 From: Martin Matuska Date: Sun, 26 Feb 2017 23:43:56 +0100 Subject: test_main: compact canNodump() source code a bit --- test_utils/test_main.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'test_utils') diff --git a/test_utils/test_main.c b/test_utils/test_main.c index a50ed23f..8ae6c444 100644 --- a/test_utils/test_main.c +++ b/test_utils/test_main.c @@ -2326,11 +2326,10 @@ canXz(void) /* * Can this filesystem handle nodump flags. */ -#if defined(HAVE_STRUCT_STAT_ST_FLAGS) && defined(UF_NODUMP) - int canNodump(void) { +#if defined(HAVE_STRUCT_STAT_ST_FLAGS) && defined(UF_NODUMP) const char *path = "cannodumptest"; struct stat sb; @@ -2341,16 +2340,10 @@ canNodump(void) return (0); if (sb.st_flags & UF_NODUMP) return (1); - return (0); -} - #elif (defined(FS_IOC_GETFLAGS) && defined(HAVE_WORKING_FS_IOC_GETFLAGS) \ && defined(FS_NODUMP_FL)) || \ (defined(EXT2_IOC_GETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS) \ && defined(EXT2_NODUMP_FL)) -int -canNodump(void) -{ const char *path = "cannodumptest"; int fd, r, flags; @@ -2401,19 +2394,10 @@ canNodump(void) if (flags & EXT2_NODUMP_FL) #endif return (1); +#endif return (0); } -#else - -int -canNodump() -{ - return (0); -} - -#endif - /* * Sleep as needed; useful for verifying disk timestamp changes by * ensuring that the wall-clock time has actually changed before we -- cgit v1.2.1