X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fsource.c;h=6979fb2817ddbbb76a22942bc0a87298e541667f;hb=25e3c82c0e927398e759e2d5e35623012b8683f7;hp=04ee3b33d204db93f2918a75f5a239da15e1f3fc;hpb=b4987c956dfa44ca9fd8552f63e15f5fa094b2a4;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/source.c b/gdb/source.c index 04ee3b33d2..6979fb2817 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -29,7 +29,6 @@ #include "filestuff.h" #include -#include #include #include "gdbcore.h" #include "gdb_regex.h" @@ -670,39 +669,6 @@ info_source_command (const char *ignore, int from_tty) } -/* Return True if the file NAME exists and is a regular file. - If the result is false then *ERRNO_PTR is set to a useful value assuming - we're expecting a regular file. */ - -static int -is_regular_file (const char *name, int *errno_ptr) -{ - struct stat st; - const int status = stat (name, &st); - - /* Stat should never fail except when the file does not exist. - If stat fails, analyze the source of error and return True - unless the file does not exist, to avoid returning false results - on obscure systems where stat does not work as expected. */ - - if (status != 0) - { - if (errno != ENOENT) - return 1; - *errno_ptr = ENOENT; - return 0; - } - - if (S_ISREG (st.st_mode)) - return 1; - - if (S_ISDIR (st.st_mode)) - *errno_ptr = EISDIR; - else - *errno_ptr = EINVAL; - return 0; -} - /* Open a file named STRING, searching path PATH (dir names sep by some char) using mode MODE in the calls to open. You cannot use this function to create files (O_CREAT).