From: Pádraig Brady Date: Thu, 20 Feb 2025 12:54:53 +0000 (+0000) Subject: maint: fix sc_tight_scope failure X-Git-Tag: v9.7~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4696724eb1698277b10c7e687a19ad8c1540cde4;p=thirdparty%2Fcoreutils.git maint: fix sc_tight_scope failure This reverts commit 83fb600a21c6bad362b5739e7a9a9780639fa550. --- diff --git a/src/chown-core.c b/src/chown-core.c index cb7f9093fd..0e08f93e60 100644 --- a/src/chown-core.c +++ b/src/chown-core.c @@ -54,7 +54,7 @@ enum RCH_status RC_error }; -void +extern void chopt_init (struct Chown_option *chopt) { chopt->verbosity = V_off; @@ -66,7 +66,7 @@ chopt_init (struct Chown_option *chopt) chopt->group_name = nullptr; } -void +extern void chopt_free (struct Chown_option *chopt) { free (chopt->user_name); @@ -99,7 +99,7 @@ gid_to_str (gid_t gid) and return it. If there's no corresponding group name, use the decimal representation of the ID. */ -char * +extern char * gid_to_name (gid_t gid) { struct group *grp = getgrgid (gid); @@ -110,7 +110,7 @@ gid_to_name (gid_t gid) and return it. If there's no corresponding user name, use the decimal representation of the ID. */ -char * +extern char * uid_to_name (uid_t uid) { struct passwd *pwd = getpwuid (uid); @@ -532,7 +532,7 @@ change_file_owner (FTS *fts, FTSENT *ent, If REQUIRED_UID and/or REQUIRED_GID is not -1, then change only files with user ID and group ID that match the non-(-1) value(s). Return true if successful. */ -bool +extern bool chown_files (char **files, int bit_flags, uid_t uid, gid_t gid, uid_t required_uid, gid_t required_gid, diff --git a/src/copy.c b/src/copy.c index bb98ff7359..22d9830ba6 100644 --- a/src/copy.c +++ b/src/copy.c @@ -2017,7 +2017,7 @@ overwrite_ok (struct cp_options const *x, char const *dst_name, /* Initialize the hash table implementing a set of F_triple entries corresponding to destination files. */ -void +extern void dest_info_init (struct cp_options *x) { x->dest_info @@ -2032,7 +2032,7 @@ dest_info_init (struct cp_options *x) /* Initialize the hash table implementing a set of F_triple entries corresponding to source files listed on the command line. */ -void +extern void src_info_init (struct cp_options *x) { @@ -3374,7 +3374,7 @@ valid_options (const struct cp_options *co) the source was simply renamed to the destination. Return true if successful. */ -bool +extern bool copy (char const *src_name, char const *dst_name, int dst_dirfd, char const *dst_relname, int nonexistent_dst, const struct cp_options *options, @@ -3402,7 +3402,7 @@ copy (char const *src_name, char const *dst_name, /* Set *X to the default options for a value of type struct cp_options. */ -void +extern void cp_options_default (struct cp_options *x) { memset (x, 0, sizeof *x); @@ -3428,7 +3428,7 @@ cp_options_default (struct cp_options *x) the error number that chown failed with and X is the copying option set. */ -bool +extern bool chown_failure_ok (struct cp_options const *x) { /* If non-root uses -p, it's ok if we can't preserve ownership. @@ -3462,7 +3462,7 @@ owner_failure_ok (struct cp_options const *x) some operating systems (e.g., GNU/Linux's "POSIX" ACLs) use that ACL's mask rather than the process umask. Currently, the callers of cached_umask incorrectly assume that this situation cannot occur. */ -mode_t +extern mode_t cached_umask (void) { static mode_t mask = (mode_t) -1; diff --git a/src/cp-hash.c b/src/cp-hash.c index c6f7752181..e42bd7e300 100644 --- a/src/cp-hash.c +++ b/src/cp-hash.c @@ -78,7 +78,7 @@ src_to_dest_free (void *x) /* Remove the entry matching INO/DEV from the table that maps source ino/dev to destination file name. */ -void +extern void forget_created (ino_t ino, dev_t dev) { struct Src_to_dest probe; @@ -96,7 +96,7 @@ forget_created (ino_t ino, dev_t dev) /* If INO/DEV correspond to an already-copied source file, return the name of the corresponding destination file. Otherwise, return nullptr. */ -char * +extern char * src_to_dest_lookup (ino_t ino, dev_t dev) { struct Src_to_dest ent; @@ -111,7 +111,7 @@ src_to_dest_lookup (ino_t ino, dev_t dev) to the list of files we have copied. Return nullptr if inserted, otherwise a non-null pointer. */ -char * +extern char * remember_copied (char const *name, ino_t ino, dev_t dev) { struct Src_to_dest *ent; @@ -143,7 +143,7 @@ remember_copied (char const *name, ino_t ino, dev_t dev) } /* Initialize the hash table. */ -void +extern void hash_init (void) { src_to_dest = hash_initialize (INITIAL_TABLE_SIZE, nullptr, diff --git a/src/csplit.c b/src/csplit.c index f706ca4c7e..9119dcf5a3 100644 --- a/src/csplit.c +++ b/src/csplit.c @@ -221,7 +221,7 @@ cleanup_fatal (void) exit (EXIT_FAILURE); } -void +extern void xalloc_die (void) { error (0, 0, "%s", _("memory exhausted")); diff --git a/src/expand-common.c b/src/expand-common.c index 5526929f0a..2dbbbe492e 100644 --- a/src/expand-common.c +++ b/src/expand-common.c @@ -72,7 +72,7 @@ int exit_status = EXIT_SUCCESS; /* Add tab stop TABVAL to the end of 'tab_list'. */ -void +extern void add_tab_stop (colno tabval) { colno prev_column = first_free_tab ? tab_list[first_free_tab - 1] : 0; @@ -125,7 +125,7 @@ set_increment_size (colno tabval) /* Add the comma or blank separated list of tab stops STOPS to the list of tab stops. */ -void +extern void parse_tab_stops (char const *stops) { bool have_tabval = false; @@ -256,7 +256,7 @@ validate_tab_stops (colno const *tabs, idx_t entries) tab-stops = N (if value N specified as the only value). tab-stops = distinct values given on command line (if multiple values given). */ -void +extern void finalize_tab_stops (void) { validate_tab_stops (tab_list, first_free_tab); @@ -276,7 +276,7 @@ finalize_tab_stops (void) amny multiple tab-sizes. Set *LAST_TAB depending on whether we are returning COLUMN + 1 merely because we're past the last tab. If the number would overflow, diagnose this and exit. */ -colno +extern colno get_next_tab_column (colno column, idx_t *tab_index, bool *last_tab) { *last_tab = false; @@ -321,7 +321,7 @@ get_next_tab_column (colno column, idx_t *tab_index, bool *last_tab) /* Sets new file-list */ -void +extern void set_file_list (char **list) { have_read_stdin = false; @@ -337,7 +337,7 @@ set_file_list (char **list) Open a filename of '-' as the standard input. Return nullptr if there are no more input files. */ -FILE * +extern FILE * next_file (FILE *fp) { static char *prev_file; @@ -381,7 +381,7 @@ next_file (FILE *fp) } /* */ -void +extern void cleanup_file_list_stdin (void) { if (have_read_stdin && fclose (stdin) != 0) @@ -389,7 +389,7 @@ cleanup_file_list_stdin (void) } -void +extern void emit_tab_list_info (void) { /* suppress syntax check for emit_mandatory_arg_note() */ diff --git a/src/find-mount-point.c b/src/find-mount-point.c index c6fc15af30..732e3cba72 100644 --- a/src/find-mount-point.c +++ b/src/find-mount-point.c @@ -26,7 +26,7 @@ malloced storage. FILE_STAT should be the result of stating FILE. Give a diagnostic and return nullptr if unable to determine the mount point. Exit if unable to restore current working directory. */ -char * +extern char * find_mount_point (char const *file, struct stat const *file_stat) { struct saved_cwd cwd; diff --git a/src/force-link.c b/src/force-link.c index 8c38165bbd..f173ebc9f2 100644 --- a/src/force-link.c +++ b/src/force-link.c @@ -91,7 +91,7 @@ try_link (char *dest, void *arg) -1 if successful and DSTNAME already existed, 0 if successful and DSTNAME did not already exist, and a positive errno value on failure. */ -int +extern int force_linkat (int srcdir, char const *srcname, int dstdir, char const *dstname, int flags, bool force, int linkat_errno) @@ -148,7 +148,7 @@ try_symlink (char *dest, void *arg) -1 if successful and DSTNAME already existed, 0 if successful and DSTNAME did not already exist, and a positive errno value on failure. */ -int +extern int force_symlinkat (char const *srcname, int dstdir, char const *dstname, bool force, int symlinkat_errno) { diff --git a/src/group-list.c b/src/group-list.c index 872a23d42a..184941117f 100644 --- a/src/group-list.c +++ b/src/group-list.c @@ -31,7 +31,7 @@ /* Print all of the distinct groups the user is in. */ -bool +extern bool print_group_list (char const *username, uid_t ruid, gid_t rgid, gid_t egid, bool use_names, char delim) @@ -87,7 +87,7 @@ print_group_list (char const *username, } /* Print the name or value of group ID GID. */ -bool +extern bool print_group (gid_t gid, bool use_name) { struct group *grp = nullptr; diff --git a/src/iopoll.c b/src/iopoll.c index 180dd32aa3..32b086635e 100644 --- a/src/iopoll.c +++ b/src/iopoll.c @@ -135,7 +135,7 @@ iopoll_internal (int fdin, int fdout, bool block, bool broken_output) return IOPOLL_ERROR; } -int +extern int iopoll (int fdin, int fdout, bool block) { return iopoll_internal (fdin, fdout, block, true); @@ -147,7 +147,7 @@ iopoll (int fdin, int fdout, bool block) An fd is not relevant for iopoll() if it is always ready for reading, which is the case for a regular file or block device. */ -bool +extern bool iopoll_input_ok (int fdin) { struct stat st; @@ -160,7 +160,7 @@ iopoll_input_ok (int fdin) /* Return true if fdout is suitable for iopoll(). Namely, fdout refers to a pipe. */ -bool +extern bool iopoll_output_ok (int fdout) { return isapipe (fdout) > 0; @@ -203,7 +203,7 @@ fail: /* wrapper for fclose() that also waits for F if non blocking. */ -bool +extern bool fclose_wait (FILE *f) { for (;;) @@ -221,7 +221,7 @@ fclose_wait (FILE *f) /* wrapper for fwrite() that also waits for F if non blocking. */ -bool +extern bool fwrite_wait (char const *buf, ssize_t size, FILE *f) { for (;;) diff --git a/src/operand2sig.c b/src/operand2sig.c index a0e7cda1cf..9c69de6337 100644 --- a/src/operand2sig.c +++ b/src/operand2sig.c @@ -32,7 +32,7 @@ #include "sig2str.h" #include "operand2sig.h" -int +extern int operand2sig (char const *operand) { int signum; diff --git a/src/show-date.c b/src/show-date.c index c87a73a85c..ffa3d02b7c 100644 --- a/src/show-date.c +++ b/src/show-date.c @@ -16,7 +16,7 @@ If unsuccessful and ON_ERROR_PRINT_UNFORMATTED, also prints WHEN.TV_SEC to STDOUT. */ -bool +extern bool show_date (char const *format, struct timespec when, timezone_t tz) { struct tm tm; diff --git a/src/wc_avx2.c b/src/wc_avx2.c index 452e48a43d..d75e5eac42 100644 --- a/src/wc_avx2.c +++ b/src/wc_avx2.c @@ -23,7 +23,7 @@ #include /* Read FD and return a summary. */ -struct wc_lines +extern struct wc_lines wc_lines_avx2 (int fd) { intmax_t lines = 0;