Fix compile warnings
Todo: error checking for DTSC::File::getHeader
This commit is contained in:
parent
9c0aa93bfd
commit
740d46d4be
2 changed files with 11 additions and 2 deletions
|
@ -342,5 +342,9 @@ void Util::Daemonize(){
|
|||
#if DEBUG >= 3
|
||||
fprintf(stderr, "Going into background mode...\n");
|
||||
#endif
|
||||
daemon(1, 0);
|
||||
if (daemon(1, 0) < 0) {
|
||||
#if DEBUG >= 1
|
||||
fprintf(stderr, "Failed to daemonize: %s\n", strerror(errno));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -228,7 +228,12 @@ DTSC::File::File(std::string filename, bool create){
|
|||
std::string & DTSC::File::getHeader(){
|
||||
fseek(F, 8, SEEK_SET);
|
||||
strbuffer.resize(headerSize);
|
||||
fread((void*)strbuffer.c_str(), headerSize, 1, F);
|
||||
if (fread((void*)strbuffer.c_str(), headerSize, 1, F) != headerSize){
|
||||
/// \todo check seek as well and do something more sensible...
|
||||
#if DEBUG >= 10
|
||||
fprintf(stderr, "Panic! Invalid DTSC File header\n");
|
||||
#endif
|
||||
}
|
||||
fseek(F, 8+headerSize, SEEK_SET);
|
||||
return strbuffer;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue