1.1 --- a/libfsclient/include/fsclient/client.h Sat May 15 17:10:02 2021 +0200
1.2 +++ b/libfsclient/include/fsclient/client.h Sat May 15 23:38:39 2021 +0200
1.3 @@ -41,8 +41,8 @@
1.4
1.5 /* Pipe region operations. */
1.6
1.7 -void *client_current_region(file_t *file);
1.8 -void *client_next_region(file_t *file);
1.9 +long client_current_region(file_t *file);
1.10 +long client_next_region(file_t *file);
1.11
1.12 /* File data operations. */
1.13
2.1 --- a/libfsclient/lib/src/client.cc Sat May 15 17:10:02 2021 +0200
2.2 +++ b/libfsclient/lib/src/client.cc Sat May 15 23:38:39 2021 +0200
2.3 @@ -147,16 +147,18 @@
2.4
2.5 else if (position == file->end_pos)
2.6 {
2.7 - if (client_next_region(file) == NULL)
2.8 - return -L4_EIO;
2.9 + err = client_next_region(file);
2.10 + if (err)
2.11 + return err;
2.12 }
2.13
2.14 /* Within the current pipe region, synchronise with the pipe object. */
2.15
2.16 else
2.17 {
2.18 - if (client_current_region(file) == NULL)
2.19 - return -L4_EIO;
2.20 + err = client_current_region(file);
2.21 + if (err)
2.22 + return err;
2.23 }
2.24 }
2.25
2.26 @@ -200,24 +202,24 @@
2.27
2.28 /* Obtain the current region of a pipe. */
2.29
2.30 -void *client_current_region(file_t *file)
2.31 +long client_current_region(file_t *file)
2.32 {
2.33 - if ((file == NULL) || (pipe_current(file)))
2.34 - return NULL;
2.35 + if (file == NULL)
2.36 + return -L4_EINVAL;
2.37
2.38 - return file->memory;
2.39 + return pipe_current(file);
2.40 }
2.41
2.42
2.43
2.44 /* Obtain the next region of a pipe. */
2.45
2.46 -void *client_next_region(file_t *file)
2.47 +long client_next_region(file_t *file)
2.48 {
2.49 - if ((file == NULL) || (pipe_next(file)))
2.50 - return NULL;
2.51 + if (file == NULL)
2.52 + return -L4_EINVAL;
2.53
2.54 - return file->memory;
2.55 + return pipe_next(file);
2.56 }
2.57
2.58