committed: [PATCH] fixincludes: simplify handling for access() failure [PR21283, PR80047]

Xi Ruoyao xry111@mengyan1223.wang
Sat Nov 13 18:37:45 GMT 2021


On Sat, 2021-11-13 at 08:13 -0800, Bruce Korb wrote:
> Perfect.

Committed at r12-5234 with minor format fix.

> On 11/12/21 1:58 PM, Xi Ruoyao wrote:
> > diff --git a/fixincludes/fixincl.c b/fixincludes/fixincl.c
> > index 6dba2f6e830..ee57fbf61b4 100644
> > --- a/fixincludes/fixincl.c
> > +++ b/fixincludes/fixincl.c
> > @@ -1352,11 +1352,10 @@ process (void)
> >   
> >     if (access (pz_curr_file, R_OK) != 0)
> >       {
> > -      int erno = errno;
> > -      fprintf (stderr, "Cannot access %s from %s\n\terror %d
> > (%s)\n",
> > -               pz_curr_file, getcwd ((char *) NULL, MAXPATHLEN),
> > -               erno, xstrerror (erno));
> > -      return;
> > +      /* Some really strange error happened. */
> > +      fprintf (stderr, "Cannot access %s: %s\n", pz_curr_file,
> > +              xstrerror (errno));
> > +      abort();
> >       }
> >   
> >     pz_curr_data = load_file (pz_curr_file);

-- 
Xi Ruoyao <xry111@mengyan1223.wang>
School of Aerospace Science and Technology, Xidian University


More information about the Gcc-patches mailing list