From 23bbbd0970ac1a4ce074d1fb4b380e9f8f0a8c7a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 26 Sep 2024 07:46:53 -0700 Subject: [PATCH 1/2] [maint] Stop using findprog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * HACKING: Update to match current Gnulib and our changes. * m4/gnulib-cache.m4: Stop using the findprog module, as it drags in ‘access’, which can ‘#define access rpl_access’, which messes with our use of ‘access’. Problem reported by Collin Funk in: https://lists.gnu.org/r/bug-rcs/2024-09/msg00002.html * src/b-peer.c: Do not include findprog.h. (EXEEXT): Default to empty. (find_peer_prog): Just act as though EXEEXT had been set. * src/rcsutil.c (EXECV): Remove. (runv): Just use execvp. --- ChangeLog | 10 ++++++++++ HACKING | 24 ++++++++++++++---------- m4/gnulib-cache.m4 | 2 -- src/ChangeLog | 9 +++++++++ src/b-peer.c | 29 ++++------------------------- src/rcsutil.c | 10 ++-------- 6 files changed, 39 insertions(+), 45 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3749ef8..a174dcc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2024-09-26 Paul Eggert + + [maint] Stop using findprog + * HACKING: Update to match current Gnulib and our changes. + * m4/gnulib-cache.m4: Stop using the findprog module, + as it drags in ‘access’, which can ‘#define access rpl_access’, + which messes with our use of ‘access’. Problem reported + by Collin Funk in: + https://lists.gnu.org/r/bug-rcs/2024-09/msg00002.html + 2022-02-03 Thien-Thi Nguyen Release: 5.10.1 diff --git a/HACKING b/HACKING index 3c14b33..c9f93e1 100644 --- a/HACKING +++ b/HACKING @@ -98,9 +98,10 @@ It lives in the repo but is not included in the distribution. #+BEGIN: insert-file :filename ".gnulib-utility" ; _Exit ; absolute-header - ; access + ; alignasof ; alignof ; alloca-opt + ; assert-h ; assure ; at-internal ; attribute @@ -115,7 +116,6 @@ It lives in the repo but is not included in the distribution. ; cloexec ; close ; closedir - ; concat-filename ; d-ino ; dirent ; dirfd @@ -125,8 +125,10 @@ It lives in the repo but is not included in the distribution. ; dup2 ; errno ; error + ; error-h ; exitfail ; extensions + ; extensions-aix ; extern-inline ; fchdir ; fcntl @@ -136,7 +138,6 @@ It lives in the repo but is not included in the distribution. ; fdopendir ; filename ; filenamecat-lgpl - ; findprog ; float ; fpieee ; fpucw @@ -172,16 +173,17 @@ It lives in the repo but is not included in the distribution. ; largefile ; libc-config ; limits-h - ; lock ; lstat ; malloc-gnu ; malloc-posix ; malloca ; math + ; mbszero ; memchr ; mempcpy ; memrchr ; minmax + ; mixin/printf-posix ; mkdir ; mkstemp ; msvc-inval @@ -190,6 +192,7 @@ It lives in the repo but is not included in the distribution. ; nocrash ; obstack ; obstack-printf + ; once ; open ; openat ; openat-die @@ -201,6 +204,8 @@ It lives in the repo but is not included in the distribution. ; printf-frexpl ; printf-safe ; progname + ; pthread-h + ; pthread-once ; raise ; readdir ; readlink @@ -211,6 +216,7 @@ It lives in the repo but is not included in the distribution. ; same-inode ; save-cwd ; scandir + ; sched ; sigaction ; signal ; signal-h @@ -227,14 +233,13 @@ It lives in the repo but is not included in the distribution. ; stat ; stat-time ; std-gnu11 - ; stdalign ; stdarg ; stdbool + ; stdckdint ; stddef ; stdint ; stdio ; stdlib - ; stpcpy ; strdup-posix ; strerror ; strerror-override @@ -249,6 +254,7 @@ It lives in the repo but is not included in the distribution. ; tempname ; threadlib ; time + ; time-h ; time_r ; timespec ; tls @@ -263,17 +269,15 @@ It lives in the repo but is not included in the distribution. ; vasnprintf ; verify ; vla + ; vsnzprintf + ; vszprintf ; waitpid ; wchar - ; windows-mutex ; windows-once - ; windows-recmutex - ; windows-rwlock ; windows-tls ; xalloc ; xalloc-die ; xalloc-oversized - ; xconcat-filename ; xsize #+END: diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4 index ee33784..419dbff 100644 --- a/m4/gnulib-cache.m4 +++ b/m4/gnulib-cache.m4 @@ -49,7 +49,6 @@ # extensions \ # fcntl \ # fcntl-h \ -# findprog \ # fstat \ # ftruncate \ # getcwd \ @@ -120,7 +119,6 @@ gl_MODULES([ extensions fcntl fcntl-h - findprog fstat ftruncate getcwd diff --git a/src/ChangeLog b/src/ChangeLog index 3b7c016..bab662a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2024-09-26 Paul Eggert + + [maint] Stop using findprog + * b-peer.c: Do not include findprog.h. + (EXEEXT): Default to empty. + (find_peer_prog): Just act as though EXEEXT had been set. + * rcsutil.c (EXECV): Remove. + (runv): Just use execvp. + 2022-02-03 Thien-Thi Nguyen Release: 5.10.1 diff --git a/src/b-peer.c b/src/b-peer.c index 4a2cc81..a310a2d 100644 --- a/src/b-peer.c +++ b/src/b-peer.c @@ -22,7 +22,6 @@ #include "base.h" #include #include -#include "findprog.h" #include "b-complain.h" #include "b-divvy.h" @@ -38,37 +37,17 @@ one_beyond_last_dir_sep (const char *name) : NULL; } +#ifndef EXEEXT +# define EXEEXT +#endif + char const * find_peer_prog (struct symdef *prog) { if (! prog->underlying) { size_t len; - -#ifndef EXEEXT - - /* Find the driver's invocation directory, once. */ - if (! BE (invdir)) - { - char const *name = find_in_path (PROGRAM (invoke)); - char const *end = one_beyond_last_dir_sep (name); - - if (!end) - PFATAL ("cannot determine directory (in PATH) of `%s'", name); - BE (invdir) = intern (PLEXUS, name, end - name); - if (name != PROGRAM (invoke)) - free ((void *) name); - } - - /* Concat the invocation directory with the base name. */ - accf (PLEXUS, "%s%s", BE (invdir), prog->meaningful); - -#else /* EXEEXT */ - accf (PLEXUS, "%s" EXEEXT, prog->meaningful); - -#endif /* EXEEXT */ - prog->underlying = finish_string (PLEXUS, &len); } diff --git a/src/rcsutil.c b/src/rcsutil.c index 3a76541..759247f 100644 --- a/src/rcsutil.c +++ b/src/rcsutil.c @@ -320,12 +320,6 @@ accumulate_arg_quoted (struct divvy *space, int c, register char const *s) #endif /* !defined HAVE_WORKING_FORK */ -#ifndef EXEEXT -#define EXECV execv -#else -#define EXECV execvp -#endif - int runv (int infd, char const *outname, char const **args) /* Run a command. @@ -361,13 +355,13 @@ runv (int infd, char const *outname, char const **args) O_CREAT | O_TRUNC | O_WRONLY))) exit_diff_trouble ("%s: %s: cannot create", args[1], outname); - EXECV (args[1], (char **) (args + 1)); + execvp (args[1], (char **) (args + 1)); notfound = args[1]; #ifdef RCS_SHELL if (errno == ENOEXEC) { args[0] = notfound = RCS_SHELL; - EXECV (args[0], (char **) args); + execvp (args[0], (char **) args); } #endif -- 2.43.0