mirror of
https://github.com/minetest/minetest.git
synced 2025-03-06 20:48:40 +01:00
filesys: replace goto by #else to avoid compiler warning
This commit is contained in:
parent
b861f0c5c5
commit
282c81fe3a
1 changed files with 2 additions and 7 deletions
|
@ -506,15 +506,10 @@ bool CopyFileContents(const std::string &source, const std::string &target)
|
||||||
// fallback to normal copy, but no need to reopen the files
|
// fallback to normal copy, but no need to reopen the files
|
||||||
sourcefile.reset(fdopen(srcfd, "rb"));
|
sourcefile.reset(fdopen(srcfd, "rb"));
|
||||||
targetfile.reset(fdopen(tgtfd, "wb"));
|
targetfile.reset(fdopen(tgtfd, "wb"));
|
||||||
goto fallback;
|
#else
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
sourcefile.reset(fopen(source.c_str(), "rb"));
|
sourcefile.reset(fopen(source.c_str(), "rb"));
|
||||||
targetfile.reset(fopen(target.c_str(), "wb"));
|
targetfile.reset(fopen(target.c_str(), "wb"));
|
||||||
|
#endif
|
||||||
fallback:
|
|
||||||
|
|
||||||
if (!sourcefile) {
|
if (!sourcefile) {
|
||||||
errorstream << source << ": can't open for reading: "
|
errorstream << source << ": can't open for reading: "
|
||||||
<< strerror(errno) << std::endl;
|
<< strerror(errno) << std::endl;
|
||||||
|
|
Loading…
Add table
Reference in a new issue