diff options
author | Richard Stallman <rms@gnu.org> | 1992-06-21 20:48:54 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1992-06-21 20:48:54 +0000 |
commit | 77f99bc7f19f4e230ab749f8752a556af14523e7 (patch) | |
tree | b6b6995ec5e189021b85166cc20fa6d4ddf32f79 /gcc | |
parent | 9ac73056d88ae4d548a0e6879833a907a4862f59 (diff) | |
download | gcc-77f99bc7f19f4e230ab749f8752a556af14523e7.zip gcc-77f99bc7f19f4e230ab749f8752a556af14523e7.tar.gz gcc-77f99bc7f19f4e230ab749f8752a556af14523e7.tar.bz2 |
*** empty log message ***
From-SVN: r1225
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/protoize.c | 84 |
1 files changed, 53 insertions, 31 deletions
diff --git a/gcc/protoize.c b/gcc/protoize.c index 53ae866..796040d 100644 --- a/gcc/protoize.c +++ b/gcc/protoize.c @@ -2083,6 +2083,7 @@ process_aux_info_file (base_source_filename, keep_it, is_syscalls) const char *aux_info_second_line; time_t aux_info_mtime; size_t aux_info_size; + int must_create; /* Construct the aux_info filename from the base source filename. */ @@ -2094,38 +2095,59 @@ process_aux_info_file (base_source_filename, keep_it, is_syscalls) start_over: ; - { - int retries = 0; + /* If file doesn't exist, set must_create. + Likewise if it exists and we can read it but it is obsolete. + Otherwise, report an error. */ + must_create = 0; + if (my_access (aux_info_filename, R_OK) == -1) + { + if (errno == ENOENT) + { + if (is_syscalls) + { + fprintf (stderr, "%s: warning: missing SYSCALLS file `%s'\n", + pname, aux_info_filename); + return; + } + must_create = 1; + } + else + { + fprintf (stderr, "%s: error: can't read aux info file `%s': %s\n", + pname, shortpath (NULL, aux_info_filename), + sys_errlist[errno]); + errors++; + return; + } + } +#if 0 /* There is code farther down to take care of this. */ + else + { + struct stat s1, s2; + stat (aux_info_file_name, &s1); + stat (base_source_file_name, &s2); + if (s2.st_mtime > s1.st_mtime) + must_create = 1; + } +#endif /* 0 */ -retry: - if (my_access (aux_info_filename, R_OK) == -1) - { - if (errno == ENOENT && retries == 0) - { - if (is_syscalls) - { - fprintf (stderr, "%s: warning: missing SYSCALLS file `%s'\n", - pname, aux_info_filename); - return; - } - if (!gen_aux_info_file (base_source_filename)) - { - errors++; - return; - } - retries++; - goto retry; - } - else - { - fprintf (stderr, "%s: error: can't read aux info file `%s': %s\n", - pname, shortpath (NULL, aux_info_filename), - sys_errlist[errno]); - errors++; - return; - } - } - } + /* If we need a .X file, create it, and verify we can read it. */ + if (must_create) + { + if (!gen_aux_info_file (base_source_filename)) + { + errors++; + return; + } + if (my_access (aux_info_filename, R_OK) == -1) + { + fprintf (stderr, "%s: error: can't read aux info file `%s': %s\n", + pname, shortpath (NULL, aux_info_filename), + sys_errlist[errno]); + errors++; + return; + } + } { struct stat stat_buf; |