You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-misc/mc/files/mc-4.8.1-fix-vfs-test.patch

185 lines
5.5 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

commit 931819039e78d7b1465077709988a611df4752c2
Author: Sergei Trofimovich <slyfox@gentoo.org>
Date: Mon Feb 13 14:14:50 2012 +0300
Ticket #2732: fix vfs test build failure on alpha
The test fails to compile on alpha:
> CC vfs_parse_ls_lga.o
> vfs_parse_ls_lga.c: In function test_vfs_parse_ls_lga:
> vfs_parse_ls_lga.c:174:9: error: unknown field st_atime specified in initializer
> vfs_parse_ls_lga.c:175:9: error: unknown field st_mtime specified in initializer
as st_atime on alpha in not just a field name:
struct stat {
...
__extension__ union { struct timespec st_atim; struct { __time_t st_atime; unsigned long st_atimensec; }; };
__extension__ union { struct timespec st_mtim; struct { __time_t st_mtime; unsigned long st_mtimensec; }; };
__extension__ union { struct timespec st_ctim; struct { __time_t st_ctime; unsigned long st_ctimensec; }; };
};
The fix switches to old-style struct initialization.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
diff --git a/tests/lib/vfs/vfs_parse_ls_lga.c b/tests/lib/vfs/vfs_parse_ls_lga.c
index f44559d..d16711e 100644
--- a/tests/lib/vfs/vfs_parse_ls_lga.c
+++ b/tests/lib/vfs/vfs_parse_ls_lga.c
@@ -155,90 +155,88 @@ START_TEST (test_vfs_parse_ls_lga)
{
size_t filepos = 0;
+ struct stat etalon_stat;
+
+ etalon_stat.st_dev = 0;
+ etalon_stat.st_ino = 0;
+ etalon_stat.st_mode = 0x41fd;
+ etalon_stat.st_nlink = 10;
+ etalon_stat.st_uid = 500;
+ etalon_stat.st_gid = 500;
+ etalon_stat.st_rdev = 0;
+ etalon_stat.st_size = 4096;
+ etalon_stat.st_blksize = 512;
+ etalon_stat.st_blocks = 8;
+ etalon_stat.st_atime = 1308838140;
+ etalon_stat.st_mtime = 1308838140;
+ etalon_stat.st_ctime = 1308838140;
+
vfs_parse_ls_lga_init();
check_vfs_parse_ls_lga_call(
"drwxrwxr-x 10 500 500 4096 Jun 23 17:09 build_root",
- 1, "build_root", NULL, (struct stat)
- {
- .st_dev = 0,
- .st_ino = 0,
- .st_mode = 0x41fd,
- .st_nlink = 10,
- .st_uid = 500,
- .st_gid = 500,
- .st_rdev = 0,
- .st_size = 4096,
- .st_blksize = 512,
- .st_blocks = 8,
- .st_atime = 1308838140,
- .st_mtime = 1308838140,
- .st_ctime = 1308838140
- },
+ 1, "build_root", NULL, etalon_stat,
NULL
);
+ etalon_stat.st_dev = 0;
+ etalon_stat.st_ino = 0;
+ etalon_stat.st_mode = 0xa1ff;
+ etalon_stat.st_nlink = 10;
+ etalon_stat.st_uid = 500;
+ etalon_stat.st_gid = 500;
+ etalon_stat.st_rdev = 0;
+ etalon_stat.st_size = 11;
+ etalon_stat.st_blksize = 512;
+ etalon_stat.st_blocks = 1;
+ etalon_stat.st_atime = 1268431200;
+ etalon_stat.st_mtime = 1268431200;
+ etalon_stat.st_ctime = 1268431200;
+
check_vfs_parse_ls_lga_call(
"lrwxrwxrwx 1 500 500 11 Mar 13 2010 COPYING -> doc/COPYING",
- 1, "COPYING", "doc/COPYING",
- (struct stat)
- {
- .st_dev = 0,
- .st_ino = 0,
- .st_mode = 0xa1ff,
- .st_nlink = 10,
- .st_uid = 500,
- .st_gid = 500,
- .st_rdev = 0,
- .st_size = 11,
- .st_blksize = 512,
- .st_blocks = 1,
- .st_atime = 1268431200,
- .st_mtime = 1268431200,
- .st_ctime = 1268431200
- },
+ 1, "COPYING", "doc/COPYING", etalon_stat,
NULL
);
+ etalon_stat.st_dev = 0;
+ etalon_stat.st_ino = 0;
+ etalon_stat.st_mode = 0x41fd;
+ etalon_stat.st_nlink = 10;
+ etalon_stat.st_uid = 500;
+ etalon_stat.st_gid = 500;
+ etalon_stat.st_rdev = 0;
+ etalon_stat.st_size = 4096;
+ etalon_stat.st_blksize = 512;
+ etalon_stat.st_blocks = 8;
+ etalon_stat.st_atime = 1308838140;
+ etalon_stat.st_mtime = 1308838140;
+ etalon_stat.st_ctime = 1308838140;
+
check_vfs_parse_ls_lga_call(
"drwxrwxr-x 10 500 500 4096 Jun 23 17:09 ..",
- 1, "..", NULL, (struct stat)
- {
- .st_dev = 0,
- .st_ino = 0,
- .st_mode = 0x41fd,
- .st_nlink = 10,
- .st_uid = 500,
- .st_gid = 500,
- .st_rdev = 0,
- .st_size = 4096,
- .st_blksize = 512,
- .st_blocks = 8,
- .st_atime = 1308838140,
- .st_mtime = 1308838140,
- .st_ctime = 1308838140
- },
+ 1, "..", NULL, etalon_stat,
&filepos
);
+
+ etalon_stat.st_dev = 0;
+ etalon_stat.st_ino = 0;
+ etalon_stat.st_mode = 0x41fd;
+ etalon_stat.st_nlink = 10;
+ etalon_stat.st_uid = 500;
+ etalon_stat.st_gid = 500;
+ etalon_stat.st_rdev = 0;
+ etalon_stat.st_size = 4096;
+ etalon_stat.st_blksize = 512;
+ etalon_stat.st_blocks = 8;
+ etalon_stat.st_atime = 1308838140;
+ etalon_stat.st_mtime = 1308838140;
+ etalon_stat.st_ctime = 1308838140;
+
check_vfs_parse_ls_lga_call(
"drwxrwxr-x 10 500 500 4096 Jun 23 17:09 build_root",
- 1, "build_root", NULL, (struct stat)
- {
- .st_dev = 0,
- .st_ino = 0,
- .st_mode = 0x41fd,
- .st_nlink = 10,
- .st_uid = 500,
- .st_gid = 500,
- .st_rdev = 0,
- .st_size = 4096,
- .st_blksize = 512,
- .st_blocks = 8,
- .st_atime = 1308838140,
- .st_mtime = 1308838140,
- .st_ctime = 1308838140
- },
+ 1, "build_root", NULL, etalon_stat,
&filepos
);