check for an error openning the download file (this is what I intended to

commit previously, but wasn't finished)
This commit is contained in:
Bill Currie 2001-01-22 22:48:22 +00:00
parent e3674945ed
commit b3a9da279b

View file

@ -36,6 +36,7 @@
# include <strings.h>
#endif
#include <errno.h>
#include <ctype.h>
#include <sys/types.h>
#ifdef HAVE_NETINET_IN_H
@ -1138,10 +1139,15 @@ CL_Download_f (void)
strncpy (cls.downloadtempname, cls.downloadname,
sizeof (cls.downloadtempname));
cls.download = Qopen (cls.downloadname, "wb");
cls.downloadtype = dl_single;
if (cls.download) {
cls.downloadtype = dl_single;
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
SZ_Print (&cls.netchan.message, va ("download %s\n", Cmd_Argv (1)));
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
SZ_Print (&cls.netchan.message, va ("download %s\n", Cmd_Argv (1)));
} else {
Con_Printf ("error downloading %s: %s\n", Cmd_Argv (1),
strerror (errno));
}
}
#ifdef _WIN32