From: Aidan Hobson Sayers aidanhs@cantab.net
This fixes a bug in wine when running on 9pfs where short reads would occur, causing binaries to be loaded incorrectly. All other filesystems on Linux ignore O_NONBLOCK for regular files, so this should not affect them.
Thanks to Paul Gofman for the advice on this fix. --- server/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/server/file.c b/server/file.c index 76c687833c9..a96a55ffab3 100644 --- a/server/file.c +++ b/server/file.c @@ -266,7 +266,7 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si access = map_access( access, &file_type.mapping );
/* FIXME: should set error to STATUS_OBJECT_NAME_COLLISION if file existed before */ - fd = open_fd( root, name, nt_name, flags | O_NONBLOCK, &mode, access, sharing, options ); + fd = open_fd( root, name, nt_name, flags, &mode, access, sharing, options ); if (!fd) goto done;
if (S_ISDIR(mode))