Use closex() instead of close() in OutputFile::dump().
committer: mfx <mfx> 976878029 +0000
This commit is contained in:
parent
2ed6608f08
commit
4c2597d88b
10
src/file.cpp
10
src/file.cpp
@ -231,13 +231,13 @@ void InputFile::sopen(const char *name, int flags, int shflags)
|
||||
}
|
||||
|
||||
|
||||
int InputFile::read(void * buf, int len)
|
||||
int InputFile::read(void *buf, int len)
|
||||
{
|
||||
return super::read(buf,len);
|
||||
}
|
||||
|
||||
|
||||
int InputFile::readx(void * buf, int len)
|
||||
int InputFile::readx(void *buf, int len)
|
||||
{
|
||||
return super::readx(buf,len);
|
||||
}
|
||||
@ -331,7 +331,7 @@ bool OutputFile::openStdout(int flags, bool force)
|
||||
}
|
||||
|
||||
|
||||
void OutputFile::write(const void * buf, int len)
|
||||
void OutputFile::write(const void *buf, int len)
|
||||
{
|
||||
super::write(buf,len);
|
||||
bytes_written += len;
|
||||
@ -346,7 +346,7 @@ void OutputFile::dump(const char *name, const void *buf, int len, int flags)
|
||||
OutputFile f;
|
||||
f.open(name, flags, 0666);
|
||||
f.write(buf, len);
|
||||
f.close();
|
||||
f.closex();
|
||||
}
|
||||
|
||||
|
||||
@ -360,7 +360,7 @@ MemoryOutputFile::MemoryOutputFile() :
|
||||
}
|
||||
|
||||
|
||||
void MemoryOutputFile::write(const void * buf, int len)
|
||||
void MemoryOutputFile::write(const void *buf, int len)
|
||||
{
|
||||
if (!isOpen() || len < 0)
|
||||
throwIOException("bad write");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user