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

2021-11-13 Thread Xi Ruoyao via Gcc-patches
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 > > +++

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

2021-11-13 Thread Bruce Korb via Gcc-patches
Perfect. 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) { -

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

2021-11-12 Thread Xi Ruoyao via Gcc-patches
POSIX says: On some implementations, if buf is a null pointer, getcwd() may obtain size bytes of memory using malloc(). In this case, the pointer returned by getcwd() may be used as the argument in a subsequent call to free(). Invoking getcwd() with buf as a null pointer is not