From c7e85d0c08ccbfc7604f6d50579c3a4b25281ff1 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 18 Jan 2000 10:53:15 +0000 Subject: [PATCH] Update. * posix/TESTS: Fix expected result for test cases with * with no leading expression. --- ChangeLog | 3 +++ posix/TESTS | 8 ++++---- posix/testcases.h | 8 ++++---- sysdeps/unix/sysv/linux/fstatvfs.c | 3 ++- sysdeps/unix/sysv/linux/internal_statvfs.c | 2 +- sysdeps/unix/sysv/linux/statvfs.c | 13 +++++++++---- 6 files changed, 23 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index bf61b9dc39..e29203afc5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2000-01-18 Ulrich Drepper + * posix/TESTS: Fix expected result for test cases with * with no + leading expression. + * sysdeps/unix/sysv/linux/fstatvfs.c: Move actual code in... * sysdeps/unix/sysv/linux/internal_statvfs.c: ...here. New file. * sysdeps/unix/sysv/linux/statvfs.c: Don't use fstatvfs since the diff --git a/posix/TESTS b/posix/TESTS index 858e22315e..f2c9886405 100644 --- a/posix/TESTS +++ b/posix/TESTS @@ -54,10 +54,10 @@ 0:ab|cd:abcd 0:()ef:def 0:()*:- -1:*a:- -0:^*:- -0:$*:- -1:(*)b:- +2:*a:- +2:^*:- +2:$*:- +2:(*)b:- 1:$b:b 2:a\:- 0:a\(b:a(b diff --git a/posix/testcases.h b/posix/testcases.h index 5f3b38921a..834f53049f 100644 --- a/posix/testcases.h +++ b/posix/testcases.h @@ -54,10 +54,10 @@ {0, "ab|cd", "abcd"}, {0, "()ef", "def"}, {0, "()*", "-"}, - {1, "*a", "-"}, - {0, "^*", "-"}, - {0, "$*", "-"}, - {1, "(*)b", "-"}, + {2, "*a", "-"}, + {2, "^*", "-"}, + {2, "$*", "-"}, + {2, "(*)b", "-"}, {1, "$b", "b"}, {2, "a\\", "-"}, {0, "a\\(b", "a(b"}, diff --git a/sysdeps/unix/sysv/linux/fstatvfs.c b/sysdeps/unix/sysv/linux/fstatvfs.c index dbc4c552a5..b69bf77cb6 100644 --- a/sysdeps/unix/sysv/linux/fstatvfs.c +++ b/sysdeps/unix/sysv/linux/fstatvfs.c @@ -37,8 +37,9 @@ fstatvfs (int fd, struct statvfs *buf) if (__fstatfs (fd, &fsbuf) < 0) return -1; +#define STAT(st) fstat (fd, st) #include "internal_statvfs.c" - + /* We signal success if the statfs call succeeded. */ return 0; } diff --git a/sysdeps/unix/sysv/linux/internal_statvfs.c b/sysdeps/unix/sysv/linux/internal_statvfs.c index 24765dcf5e..2ea380d5cd 100644 --- a/sysdeps/unix/sysv/linux/internal_statvfs.c +++ b/sysdeps/unix/sysv/linux/internal_statvfs.c @@ -40,7 +40,7 @@ file. The way we can test for matching filesystem is using the device number. */ buf->f_flag = 0; - if (fstat (fd, &st) >= 0) + if (STAT (&st) >= 0) { int save_errno = errno; struct mntent mntbuf; diff --git a/sysdeps/unix/sysv/linux/statvfs.c b/sysdeps/unix/sysv/linux/statvfs.c index 9bbe6c2f99..7f85c9b726 100644 --- a/sysdeps/unix/sysv/linux/statvfs.c +++ b/sysdeps/unix/sysv/linux/statvfs.c @@ -18,8 +18,12 @@ Boston, MA 02111-1307, USA. */ #include -#include -#include +#include +#include +#include +#include +#include +#include #include @@ -30,11 +34,12 @@ statvfs (const char *file, struct statvfs *buf) struct stat st; /* Get as much information as possible from the system. */ - if (__statfs (fd, &fsbuf) < 0) + if (__statfs (file, &fsbuf) < 0) return -1; +#define STAT(st) stat (file, st) #include "internal_statvfs.c" - + /* We signal success if the statfs call succeeded. */ return 0; }