Fixed Linux build.

This commit is contained in:
David Anderson 2009-03-01 01:58:42 -05:00
parent 6ebbb48f9f
commit 037ea592ab
3 changed files with 14 additions and 6 deletions

View File

@ -76,7 +76,7 @@ ifeq "$(USEMETA)" "true"
CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_LEFT4DEAD=4
else
INCLUDE += -I. -I.. -Isdk -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn \
-I$(SMSDK)/public/extensions
-I$(SMSDK)/public/extensions -I$(MMSOURCE17)/core/sourcehook
endif
LINK += -m32 -lm -ldl

View File

@ -37,6 +37,8 @@
#include <sh_string.h>
#include "MemoryDownloader.h"
using namespace SourceHook;
struct UpdatePart
{
UpdatePart* next;

View File

@ -159,12 +159,18 @@ static void PumpUpdate(void *data)
AddUpdateError("Could not open %s for writing", path);
return;
}
fwrite(part->data, 1, part->length, fp);
if (fwrite(part->data, 1, part->length, fp) != part->length)
{
AddUpdateError("Could not write file %s", path);
}
else
{
smutils->LogMessage(myself,
"Successfully updated gamedata file \"%s\"",
part->file);
new_files = true;
}
fclose(fp);
smutils->LogMessage(myself,
"Successfully updated gamedata file \"%s\"",
part->file);
new_files = true;
}
skip_create:
temp = part->next;