From 0348212609315bdeb8ab22e777da93acb6be6a22 Mon Sep 17 00:00:00 2001 From: Lawson Whitney Date: Thu, 14 Dec 2000 20:30:13 +0000 Subject: [PATCH] Add strerror() to the "Could not stat" and "Invalid path" startup error messages. --- files/directory.c | 7 ++++--- files/drive.c | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/files/directory.c b/files/directory.c index 7bf312fba0e..9dc7affd6a0 100644 --- a/files/directory.c +++ b/files/directory.c @@ -48,13 +48,14 @@ static int DIR_GetPath( const char *keyname, const char *defval, { char path[MAX_PATHNAME_LEN]; BY_HANDLE_FILE_INFORMATION info; + const char *mess = "does not exist"; PROFILE_GetWineIniString( "wine", keyname, defval, path, sizeof(path) ); if (!DOSFS_GetFullName( path, TRUE, full_name ) || - !FILE_Stat( full_name->long_name, &info ) || - !(info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) + (!FILE_Stat( full_name->long_name, &info ) && (mess=strerror(errno)))|| + (!(info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && (mess="not a directory"))) { - MESSAGE("Invalid path '%s' for %s directory\n", path, keyname); + MESSAGE("Invalid path '%s' for %s directory: %s\n", path, keyname, mess); return 0; } return 1; diff --git a/files/drive.c b/files/drive.c index 9981ed6900f..56974278a08 100644 --- a/files/drive.c +++ b/files/drive.c @@ -168,7 +168,8 @@ int DRIVE_Init(void) if (stat( path, &drive_stat_buffer )) { - MESSAGE("Could not stat %s, ignoring drive %c:\n", path, 'A' + i ); + MESSAGE("Could not stat %s, ignoring drive %c: %s\n", + path, 'A' + i, strerror(errno)); continue; } if (!S_ISDIR(drive_stat_buffer.st_mode))