Make the FSTYPE macros take tc instead of derivative type "type".

ok njoly
This commit is contained in:
pooka 2010-07-13 11:12:19 +00:00
parent 5559382642
commit 5b92553888
2 changed files with 20 additions and 15 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: h_fsmacros.h,v 1.7 2010/07/12 21:37:47 njoly Exp $ */
/* $NetBSD: h_fsmacros.h,v 1.8 2010/07/13 11:12:19 pooka Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -111,11 +111,19 @@ atf_check_fstype(const atf_tc_t *tc, const char *fs)
atf_tc_skip("filesystem not selected");
}
#define FSTYPE_EXT2FS(type) (strcmp(type, MOUNT_EXT2FS) == 0)
#define FSTYPE_FFS(type) (strcmp(type, MOUNT_FFS) == 0)
#define FSTYPE_LFS(type) (strcmp(type, MOUNT_LFS) == 0)
#define FSTYPE_MSDOS(type) (strcmp(type, MOUNT_MSDOS) == 0)
#define FSTYPE_SYSVBFS(type) (strcmp(type, MOUNT_SYSVBFS) == 0)
#define FSTYPE_TMPFS(type) (strcmp(type, MOUNT_TMPFS) == 0)
#define FSTYPE_EXT2FS(tc)\
(strcmp(atf_tc_get_md_var(tc, "X-fs.type"), MOUNT_EXT2FS) == 0)
#define FSTYPE_FFS(tc)\
(strcmp(atf_tc_get_md_var(tc, "X-fs.type"), MOUNT_FFS) == 0)
#define FSTYPE_LFS(tc)\
(strcmp(atf_tc_get_md_var(tc, "X-fs.type"), MOUNT_LFS) == 0)
#define FSTYPE_MSDOS(tc)\
(strcmp(atf_tc_get_md_var(tc, "X-fs.type"), MOUNT_MSDOS) == 0)
#define FSTYPE_PUFFS(tc)\
(strcmp(atf_tc_get_md_var(tc, "X-fs.type"), MOUNT_PUFFS) == 0)
#define FSTYPE_SYSVBFS(tc)\
(strcmp(atf_tc_get_md_var(tc, "X-fs.type"), MOUNT_SYSVBFS) == 0)
#define FSTYPE_TMPFS(tc)\
(strcmp(atf_tc_get_md_var(tc, "X-fs.type"), MOUNT_TMPFS) == 0)
#endif /* __H_FSMACROS_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_rmdirrace.c,v 1.5 2010/07/12 21:05:20 njoly Exp $ */
/* $NetBSD: t_rmdirrace.c,v 1.6 2010/07/13 11:12:19 pooka Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -64,16 +64,13 @@ static void *func2(void *arg)
static void
race(const atf_tc_t *tc, const char *path)
{
const char *type;
int res, fd, quit;
pthread_t th1, th2;
type = atf_tc_get_md_var(tc, "X-fs.type");
if (FSTYPE_LFS(type))
if (FSTYPE_LFS(tc))
atf_tc_expect_signal(-1, "PR kern/43582");
if (FSTYPE_SYSVBFS(type))
atf_tc_skip("%s does not support rmdir(2)", type);
if (FSTYPE_SYSVBFS(tc))
atf_tc_skip("rmdir(2) not supported by file system");
fd = rump_sys_open(".", O_RDONLY, 0666);
if (fd == -1)
@ -111,7 +108,7 @@ race(const atf_tc_t *tc, const char *path)
* saying "just chill even if the test doesn't fail", so this
* takes care of it.
*/
if (FSTYPE_LFS(type))
if (FSTYPE_LFS(tc))
abort();
}