From 92c7311b1cb354745ec7b59b0e03910b3fe4c205 Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Thu, 5 Mar 2009 14:34:31 -0800 Subject: auto import from //depot/cupcake/@136594 --- android/utils/path.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'android/utils') diff --git a/android/utils/path.c b/android/utils/path.c index b15b6de..e7ef2b0 100644 --- a/android/utils/path.c +++ b/android/utils/path.c @@ -34,7 +34,8 @@ #include #endif -#define D(...) ((void)0) +#include "android/utils/debug.h" +#define D(...) VERBOSE_PRINT(init,__VA_ARGS__) #ifndef CHECKED # ifdef _WIN32 @@ -457,6 +458,12 @@ path_copy_file( const char* dest, const char* source ) return -1; } + if ( access(source, R_OK) < 0 ) { + D("%s: source file is un-readable: %s\n", + __FUNCTION__, source); + return -1; + } + #ifdef _WIN32 fd = _open(dest, _O_RDWR | _O_BINARY); fs = _open(source, _O_RDONLY | _O_BINARY); -- cgit v1.1