1.1 --- a/libfsclient/lib/src/client.cc Tue Feb 14 21:05:14 2023 +0100
1.2 +++ b/libfsclient/lib/src/client.cc Tue Feb 14 23:36:10 2023 +0100
1.3 @@ -1,7 +1,8 @@
1.4 /*
1.5 * Filesystem client functions.
1.6 *
1.7 - * Copyright (C) 2018, 2019, 2020, 2021, 2022 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2018, 2019, 2020, 2021, 2022,
1.9 + * 2023 Paul Boddie <paul@boddie.org.uk>
1.10 *
1.11 * This program is free software; you can redistribute it and/or
1.12 * modify it under the terms of the GNU General Public License as
1.13 @@ -333,6 +334,26 @@
1.14
1.15
1.16
1.17 +/* Open another instance of an opened filesystem object. */
1.18 +
1.19 +file_t *client_reopen(file_t *file, flags_t flags)
1.20 +{
1.21 + if (file == NULL)
1.22 + return NULL;
1.23 +
1.24 + file_t *new_file = (file_t *) malloc(sizeof(file_t));
1.25 +
1.26 + if (new_file == NULL)
1.27 + return NULL;
1.28 +
1.29 + /* Return any allocated structure even if an error occurs. */
1.30 +
1.31 + new_file->error = file_reopen(file, new_file, flags);
1.32 + return new_file;
1.33 +}
1.34 +
1.35 +
1.36 +
1.37 /* Open a pipe object, returning any error condition. */
1.38
1.39 long client_pipe(file_t **reader, file_t **writer, flags_t flags)