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 CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_LEFT4DEAD=4
else else
INCLUDE += -I. -I.. -Isdk -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn \ INCLUDE += -I. -I.. -Isdk -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn \
-I$(SMSDK)/public/extensions -I$(SMSDK)/public/extensions -I$(MMSOURCE17)/core/sourcehook
endif endif
LINK += -m32 -lm -ldl LINK += -m32 -lm -ldl

View File

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

View File

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