|
| 1 | +/* Squashfuse mount helper fuctions |
| 2 | + * |
| 3 | + * Copyright 2023 SiFive, Inc. |
| 4 | + * |
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | + * you may not use this file except in compliance with the License. |
| 7 | + * You should have received a copy of LICENSE.Apache2 along with |
| 8 | + * this software. If not, you may obtain a copy at |
| 9 | + * |
| 10 | + * https://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + * |
| 12 | + * Unless required by applicable law or agreed to in writing, software |
| 13 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | + * See the License for the specific language governing permissions and |
| 16 | + * limitations under the License. |
| 17 | + */ |
| 18 | + |
| 19 | +// Open Group Base Specifications Issue 7 |
1 | 20 | #define _XOPEN_SOURCE 700
|
2 | 21 | #define _POSIX_C_SOURCE 200809L
|
3 | 22 |
|
@@ -42,12 +61,12 @@ wcl::optional<SquashFuseMountWaitError> wait_for_squashfuse_mount(
|
42 | 61 | auto defer = wcl::make_defer([&]() { unlink(squashfuse_fifo_path.c_str()); });
|
43 | 62 |
|
44 | 63 | char squashfuse_notify_result = '\0';
|
45 |
| - ssize_t bytesRead = read(squashfuse_notify_pipe_fd->get(), &squashfuse_notify_result, |
| 64 | + ssize_t bytes_read = read(squashfuse_notify_pipe_fd->get(), &squashfuse_notify_result, |
46 | 65 | sizeof(squashfuse_notify_result));
|
47 |
| - if (bytesRead == -1) { |
| 66 | + if (bytes_read == -1) { |
48 | 67 | return wcl::some(
|
49 | 68 | SquashFuseMountWaitError{SquashFuseMountWaitErrorType::FailureToReadFifo, errno});
|
50 |
| - } else if (bytesRead == 0) { |
| 69 | + } else if (bytes_read == 0) { |
51 | 70 | return wcl::some(SquashFuseMountWaitError{SquashFuseMountWaitErrorType::ReceivedZeroBytes, -1});
|
52 | 71 | }
|
53 | 72 |
|
|
0 commit comments