mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-10 14:52:08 +00:00
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:
parent
e3674945ed
commit
b3a9da279b
1 changed files with 9 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue