1.1 --- a/libfsclient/lib/src/client.cc Sat May 11 00:49:24 2024 +0200
1.2 +++ b/libfsclient/lib/src/client.cc Sat May 11 01:47:53 2024 +0200
1.3 @@ -281,10 +281,7 @@
1.4 /* Synchronise the state of the stream, testing for pipe-based access and
1.5 switching to memory mapped access if not supported. */
1.6
1.7 - long err = client_sync_stream(stream);
1.8 -
1.9 - if (err == -L4_EBADPROTO)
1.10 - stream->object_flags |= OBJECT_SUPPORTS_MMAP;
1.11 + client_sync_stream(stream);
1.12
1.13 /* Enforce blocking if necessary.
1.14 NOTE: Ignoring any event subscription error. */
1.15 @@ -314,7 +311,13 @@
1.16 if (!client_opened(file))
1.17 return -L4_EINVAL;
1.18
1.19 - return pipe_current(file, 1);
1.20 + long err = pipe_current(file, 1);
1.21 +
1.22 + if (err != -L4_EBADPROTO)
1.23 + return err;
1.24 +
1.25 + file->object_flags |= OBJECT_SUPPORTS_MMAP;
1.26 + return file_refresh(file);
1.27 }
1.28
1.29