From bce3983f1f500094ed04bfb63f94bd0ae4f43451 Mon Sep 17 00:00:00 2001 From: Mike Goslin Date: Wed, 20 Dec 2000 20:08:44 +0000 Subject: [PATCH] *** empty log message *** --- panda/src/downloader/downloader.cxx | 42 +++++++++++++++++++++++++++-- panda/src/downloader/downloader.h | 9 ++++++- 2 files changed, 48 insertions(+), 3 deletions(-) diff --git a/panda/src/downloader/downloader.cxx b/panda/src/downloader/downloader.cxx index 4153cfbb25..0e65943498 100644 --- a/panda/src/downloader/downloader.cxx +++ b/panda/src/downloader/downloader.cxx @@ -324,7 +324,7 @@ initiate(const string &file_name, Filename file_dest, downloader_cat.error() << "Downloader::initiate() - Error opening file: " << file_dest << " for writing: " << strerror(errno) << endl; - return DL_error_write; + return get_write_error(); } // Send an HTTP request for the file to the server @@ -807,7 +807,7 @@ handle_socket_error(void) const { } //////////////////////////////////////////////////////////////////// -// Function: Downloader::error_gethostbyname +// Function: Downloader::get_network_error // Access: Private // Description: //////////////////////////////////////////////////////////////////// @@ -849,3 +849,41 @@ get_network_error(void) const { } #endif } + +//////////////////////////////////////////////////////////////////// +// Function: Downloader::get_write_error +// Access: Private +// Description: +//////////////////////////////////////////////////////////////////// +int Downloader:: +get_write_error(void) const { +#ifndef WIN32 + return DL_error_abort; +#else + switch (errno) { + case 4: + case 18: + return DL_error_write_out_of_files; + case 8: + case 14: + return DL_error_write_out_of_memory; + case 20: + return DL_error_write_disk_not_found; + case 25: + case 27: + return DL_error_write_disk_sector_not_found; + case 29: + case 30: + case 31: + return DL_error_write_disk_fault; + case 32: + case 33: + case 36: + return DL_error_write_sharing_violation; + case 39: + return DL_error_write_disk_full; + default: + return DL_error_abort; + } +#endif +} diff --git a/panda/src/downloader/downloader.h b/panda/src/downloader/downloader.h index 1774d2ada4..59ed44665c 100644 --- a/panda/src/downloader/downloader.h +++ b/panda/src/downloader/downloader.h @@ -62,7 +62,13 @@ PUBLISHED: DL_error_network_remote_host_no_response = -54, // General local errors - DL_error_write = -60, + DL_error_write_out_of_files = -60, + DL_error_write_out_of_memory = -61, + DL_error_write_sharing_violation = -62, + DL_error_write_disk_full = -63, + DL_error_write_disk_not_found = -64, + DL_error_write_disk_sector_not_found = -65, + DL_error_write_disk_fault = -66, // HTTP errors DL_error_http_server_timeout = -70, @@ -126,6 +132,7 @@ private: char *handle_socket_error(void) const; int get_network_error(void) const; + int get_write_error(void) const; private: bool _connected;