parent
b815955e09
commit
3ba471176e
|
@ -271,11 +271,8 @@ DWORD request_fs_stat(Remote *remote, Packet *packet)
|
|||
result = ERROR_NOT_ENOUGH_MEMORY;
|
||||
else
|
||||
{
|
||||
// Stat the file using the Microsoft stat wrapper so that we don't have to
|
||||
// do translations
|
||||
if (fs_stat(expanded, &buf) < 0)
|
||||
result = GetLastError();
|
||||
else
|
||||
result = fs_stat(expanded, &buf);
|
||||
if (0 == result)
|
||||
packet_add_tlv_raw(response, TLV_TYPE_STAT_BUF, &buf,
|
||||
sizeof(buf));
|
||||
}
|
||||
|
@ -288,7 +285,7 @@ DWORD request_fs_stat(Remote *remote, Packet *packet)
|
|||
if (expanded)
|
||||
free(expanded);
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -64,6 +64,10 @@ int fs_stat(LPCSTR filename, struct meterp_stat *buf) {
|
|||
buf->st_ctime = (unsigned long long)sbuf.st_ctime;
|
||||
return 0;
|
||||
} else {
|
||||
return ret;
|
||||
#ifdef _WIN32
|
||||
return GetLastError();
|
||||
#else
|
||||
return errno;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue