Commit: c15223ae3e74bbe7eb98c77ae5be823134b8657a
Parent: cbf1047d3a28cb99b788b5b607bcccd218328d93
Author: Randy Palamar
Date: Thu, 5 Sep 2024 11:38:43 -0600
don't spam warnings when we can't stat the cuda dll
Diffstat:
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/os_unix.c b/os_unix.c
@@ -16,6 +16,7 @@ typedef struct timespec os_filetime;
typedef void *os_library_handle;
+#define ERROR_FILE_STATS (os_file_stats){.timestamp = (os_filetime){0}, .filesize = -1}
typedef struct {
size filesize;
os_filetime timestamp;
@@ -66,8 +67,7 @@ os_get_file_stats(char *fname)
struct stat st;
if (stat(fname, &st) < 0) {
- fputs("os_get_file_stats: couldn't stat file\n",stderr);
- return (os_file_stats){0};
+ return ERROR_FILE_STATS;
}
return (os_file_stats){
diff --git a/os_win32.c b/os_win32.c
@@ -21,6 +21,7 @@ typedef struct {
typedef FILETIME os_filetime;
typedef HANDLE os_library_handle;
+#define ERROR_FILE_STATS (os_file_stats){.timestamp = (os_filetime){0}, .filesize = -1}
typedef struct {
size filesize;
os_filetime timestamp;
@@ -75,15 +76,14 @@ os_get_file_stats(char *fname)
{
HANDLE h = CreateFileA(fname, 0, 0, 0, OPEN_EXISTING, 0, 0);
if (h == INVALID_HANDLE_VALUE) {
- fputs("os_get_file_stats: couldn't open file\n", stderr);
- return (os_file_stats){0};
+ return ERROR_FILE_STATS;
}
BY_HANDLE_FILE_INFORMATION fileinfo;
if (!GetFileInformationByHandle(h, &fileinfo)) {
fputs("os_get_file_stats: couldn't get file info\n", stderr);
CloseHandle(h);
- return (os_file_stats){0};
+ return ERROR_FILE_STATS;
}
CloseHandle(h);