diff options
author | doko <doko@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-06-19 21:01:06 +0000 |
---|---|---|
committer | doko <doko@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-06-19 21:01:06 +0000 |
commit | 0dc1ebca5751c076a9ea07a7e6d6e8428bdbe73b (patch) | |
tree | 8f4628b585dfd1bbf58b2333cd36b27d3654d463 /gcc/file-find.c | |
parent | b6c75192521f22b4adc19304469c351cd2620012 (diff) | |
download | gcc-0dc1ebca5751c076a9ea07a7e6d6e8428bdbe73b.tar.gz |
2013-06-19 Matthias Klose <doko@ubuntu.com>
PR driver/57651
* file-find.h (find_a_file): Add a mode parameter.
* file-find.c (find_a_file): Likewise.
* gcc-ar.c (main): Call find_a_file with R_OK for the plugin,
with X_OK for the executables.
* collect2.c (main): Call find_a_file with X_OK.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200219 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/file-find.c')
-rw-r--r-- | gcc/file-find.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/file-find.c b/gcc/file-find.c index 45af9380d03..bc6b4349ef5 100644 --- a/gcc/file-find.c +++ b/gcc/file-find.c @@ -31,7 +31,7 @@ find_file_set_debug(bool debug_state) } char * -find_a_file (struct path_prefix *pprefix, const char *name) +find_a_file (struct path_prefix *pprefix, const char *name, int mode) { char *temp; struct prefix_list *pl; @@ -50,7 +50,7 @@ find_a_file (struct path_prefix *pprefix, const char *name) if (IS_ABSOLUTE_PATH (name)) { - if (access (name, X_OK) == 0) + if (access (name, mode) == 0) { strcpy (temp, name); @@ -66,7 +66,7 @@ find_a_file (struct path_prefix *pprefix, const char *name) strcpy (temp, name); strcat (temp, HOST_EXECUTABLE_SUFFIX); - if (access (temp, X_OK) == 0) + if (access (temp, mode) == 0) return temp; #endif @@ -83,7 +83,7 @@ find_a_file (struct path_prefix *pprefix, const char *name) if (stat (temp, &st) >= 0 && ! S_ISDIR (st.st_mode) - && access (temp, X_OK) == 0) + && access (temp, mode) == 0) return temp; #ifdef HOST_EXECUTABLE_SUFFIX @@ -93,7 +93,7 @@ find_a_file (struct path_prefix *pprefix, const char *name) if (stat (temp, &st) >= 0 && ! S_ISDIR (st.st_mode) - && access (temp, X_OK) == 0) + && access (temp, mode) == 0) return temp; #endif } |