diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-05 14:34:31 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-05 14:34:31 -0800 |
commit | 92c7311b1cb354745ec7b59b0e03910b3fe4c205 (patch) | |
tree | 981e45bbed625c3b207f9a05908482de9b0bdfd3 /android/utils | |
parent | 8b23a6c7e1aee255004dd19098d4c2462b61b849 (diff) | |
download | external_qemu-92c7311b1cb354745ec7b59b0e03910b3fe4c205.zip external_qemu-92c7311b1cb354745ec7b59b0e03910b3fe4c205.tar.gz external_qemu-92c7311b1cb354745ec7b59b0e03910b3fe4c205.tar.bz2 |
auto import from //depot/cupcake/@136594
Diffstat (limited to 'android/utils')
-rw-r--r-- | android/utils/path.c | 9 |
1 files changed, 8 insertions, 1 deletions
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 <signal.h> #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); |