From 0355b33d84ac027eb9fdad38c62147790c1d606b Mon Sep 17 00:00:00 2001 From: Intel A80486DX2-66 Date: Wed, 3 Jan 2024 21:49:23 +0300 Subject: [PATCH] reverse-ramdisk.c: `bytes_written`: reduce #if scope --- c-programming/reverse-ramdisk.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/c-programming/reverse-ramdisk.c b/c-programming/reverse-ramdisk.c index 5535c38..72f081c 100644 --- a/c-programming/reverse-ramdisk.c +++ b/c-programming/reverse-ramdisk.c @@ -191,9 +191,15 @@ int tf_write(int ID, size_t offset, void* src, size_t data_size) { // Write the data to the file #if IS_POSIX - ssize_t bytes_written = write(file, src, data_size); + ssize_t #else - size_t bytes_written = fwrite(src, 1, data_size, file); + size_t +#endif + bytes_written = +#if IS_POSIX + write(file, src, data_size); +#else + fwrite(src, 1, data_size, file); #endif if (