mirror of
https://git.code.sf.net/p/quake/newtree
synced 2025-02-02 04:32:24 +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>
|
# include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef HAVE_NETINET_IN_H
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
@ -1138,10 +1139,15 @@ CL_Download_f (void)
|
||||||
strncpy (cls.downloadtempname, cls.downloadname,
|
strncpy (cls.downloadtempname, cls.downloadname,
|
||||||
sizeof (cls.downloadtempname));
|
sizeof (cls.downloadtempname));
|
||||||
cls.download = Qopen (cls.downloadname, "wb");
|
cls.download = Qopen (cls.downloadname, "wb");
|
||||||
cls.downloadtype = dl_single;
|
if (cls.download) {
|
||||||
|
cls.downloadtype = dl_single;
|
||||||
|
|
||||||
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
|
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
|
||||||
SZ_Print (&cls.netchan.message, va ("download %s\n", Cmd_Argv (1)));
|
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
|
#ifdef _WIN32
|
||||||
|
|
Loading…
Reference in a new issue