Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/ds3.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <curl/curl.h>
#include <libxml/parser.h>
#include <libxml/xmlmemory.h>
#include <errno.h>

#include "ds3.h"
#include "ds3_request.h"
Expand Down Expand Up @@ -21623,6 +21624,7 @@ size_t ds3_read_from_fd(void* buffer, size_t size, size_t nmemb, void* user_data
return read(*(int*)user_data, buffer, size * nmemb);
}

#ifdef _MSC_VER
static void get_file_size_windows(const char* file_path, uint64_t* file_size) {
BY_HANDLE_FILE_INFORMATION info;
HANDLE file_handle;
Expand Down Expand Up @@ -21691,14 +21693,15 @@ static void get_file_size_windows(const char* file_path, uint64_t* file_size) {

return;
}
#endif

static void get_file_size_posix(const char* file_path, uint64_t* file_size) {
struct stat file_info;
int result;

result = stat(file_path, &file_info);
if (result != 0) {
fprintf(stderr, "Failed to get file info for '%s' res=%d errno=%d\n", file_path, result, errno);
fprintf(stderr, "Failed to get file info for '%s' res=%d errno=%d: %s\n", file_path, result, errno, strerror(errno));
*file_size = 0;
return;
}
Expand Down