| ... | @@ -1825,6 +1825,7 @@ pub const Writer = struct { | ... | @@ -1825,6 +1825,7 @@ pub const Writer = struct { |
| 1825 | if (file_reader.pos != 0) break :fcf; | 1825 | if (file_reader.pos != 0) break :fcf; |
| 1826 | if (w.pos != 0) break :fcf; | 1826 | if (w.pos != 0) break :fcf; |
| 1827 | if (limit != .unlimited) break :fcf; | 1827 | if (limit != .unlimited) break :fcf; |
| | 1828 | const size = file_reader.getSize() catch break :fcf; |
| 1828 | const rc = std.c.fcopyfile(in_fd, out_fd, null, .{ .DATA = true }); | 1829 | const rc = std.c.fcopyfile(in_fd, out_fd, null, .{ .DATA = true }); |
| 1829 | switch (posix.errno(rc)) { | 1830 | switch (posix.errno(rc)) { |
| 1830 | .SUCCESS => {}, | 1831 | .SUCCESS => {}, |
| ... | @@ -1845,10 +1846,9 @@ pub const Writer = struct { | ... | @@ -1845,10 +1846,9 @@ pub const Writer = struct { |
| 1845 | return 0; | 1846 | return 0; |
| 1846 | }, | 1847 | }, |
| 1847 | } | 1848 | } |
| 1848 | const n = if (file_reader.size) |size| size else @panic("TODO figure out how much copied"); | 1849 | file_reader.pos = size; |
| 1849 | file_reader.pos = n; | 1850 | w.pos = size; |
| 1850 | w.pos = n; | 1851 | return size; |
| 1851 | return n; | | |
| 1852 | } | 1852 | } |
| 1853 | | 1853 | |
| 1854 | return error.Unimplemented; | 1854 | return error.Unimplemented; |