xfstests: use native definition of O_DIRECT flag
PATCH 1/1 xfstests: use native definition of O_DIRECT flag
The definition of O_DIRECT in src/trunc.c causes xfstest 125 to fail when run on a Pandaboard. On ARM, the value used (0x040000) is O_DIRECTORY rather than O_DIRECT as it is on x86. Prefer the platform's native definition of O_DIRECT supplied by fcntl.h if available. Also, fix a couple of error messages to properly reflect their context.
--- src/trunc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
src/trunc.c +4 -2
@@ -26,7 +26,9 @@#include <stdlib.h> #include <string.h> +#ifndef O_DIRECT #define O_DIRECT 040000 +#endif #define WAITTIME 60#define BUFSIZE 4096
@@ -82,7 +84,7 @@ while((c=getopt(argc,argv,"f:"))!=EOF) {printf ("direct write of 1's into file\n" ); err =write (fd, buf,BUFSIZE ); -if (err <0 )perror ("buffered write failed" ); +if (err <0 )perror ("direct write failed" );close (fd);
@@ -96,7 +98,7 @@ while((c=getopt(argc,argv,"f:"))!=EOF) {printf ("buffered write of 2's into file\n" ); err =write (fd, buf,BUFSIZE ); -if (err <0 )perror ("direct write failed" ); +if (err <0 )perror ("buffered write failed" );/* 1 now on disk, but 2 data is buffered */
Signature · 1 line
1.7.10.4
Quoted 7 lines · Eric Whitney
The definition of
O_DIRECTinsrc/trunc.ccauses xfstest 125 to fail when run on a Pandaboard. On ARM, the value used (0x040000) isO_DIRECTORYrather thanO_DIRECTas it is on x86. Prefer the platform's native definition ofO_DIRECTsupplied byfcntl.hif available. Also, fix a couple of error messages to properly reflect their context.Signed-off-by Eric Whitney <[email protected]>
Looks good.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
This patch has been committed.
Thanks
--Rich
commit 5825ecd3b99ed8c177895d5e6a830133fed384ea
Author: Eric Whitney <[email protected]> Date: Tue Feb 26 21:03:22 2013 +0000
xfstests: use native definition of O_DIRECT flag
The definition of O_DIRECT in src/trunc.c causes xfstest 125 to fail when run on a Pandaboard. On ARM, the value used (0x040000) is O_DIRECTORY rather than O_DIRECT as it is on x86. Prefer the
platform's
native definition of O_DIRECT supplied by fcntl.h if available. Also, fix a couple of error messages to properly reflect their context.