Add strerror() to the "Could not stat" and "Invalid path" startup

error messages.
This commit is contained in:
Lawson Whitney 2000-12-14 20:30:13 +00:00 committed by Alexandre Julliard
parent f45f66beff
commit 0348212609
2 changed files with 6 additions and 4 deletions

View File

@ -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;

View File

@ -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))