+2018-06-25 Bruno Haible <bruno@clisp.org>
+
+ Continue to use spaces for indentation, not tabs.
+ * MODULES.html.sh: Untabify.
+ * doc/regex.texi: Likewise.
+ * lib/acl-internal.c: Likewise.
+ * lib/dfa.c: Likewise.
+ * lib/exclude.c: Likewise.
+ * lib/exclude.h: Likewise.
+ * lib/get-permissions.c: Likewise.
+ * lib/gettimeofday.c: Likewise.
+ * lib/parse-datetime.y: Likewise.
+ * lib/pselect.c: Likewise.
+ * lib/set-permissions.c: Likewise.
+ * lib/time.in.h: Likewise.
+ * m4/canonicalize.m4: Likewise.
+ * m4/gc.m4: Likewise.
+ * m4/gnulib-common.m4: Likewise.
+ * m4/pthread_sigmask.m4: Likewise.
+ * m4/vararrays.m4: Likewise.
+ * tests/test-digest.h: Likewise.
+ * tests/test-fcntl-h.c: Likewise.
+ * tests/test-timespec.c: Likewise.
+ * tests/uniwbrk/test-uc-wordbreaks.c: Likewise.
+
2018-06-25 Bruno Haible <bruno@clisp.org>
manywarnings: Don't enable -Wjump-misses-init warnings by default.
gnulib-tool --list > "$tmp/all-modules"
missed_modules=`for module in $seen_modules; do echo $module; done \
- | LC_ALL=C sort -u \
- | LC_ALL=C join -v 2 - "$tmp/all-modules"`
+ | LC_ALL=C sort -u \
+ | LC_ALL=C join -v 2 - "$tmp/all-modules"`
if test -n "$missed_modules"; then
{ find lib -type f -print; find m4 -type f -print; } | LC_ALL=C sort | sed -e '/\/\./d' -e /README/d -e /ChangeLog/d -e /Makefile/d -e /TODO/d -e '/tags$/d' -e '/TAGS$/d' -e '/~$/d' > "$tmp/all-files"
missed_files=`for file in $seen_files; do echo $file; done \
- | LC_ALL=C sort -u \
- | LC_ALL=C join -v 2 - "$tmp/all-files"`
+ | LC_ALL=C sort -u \
+ | LC_ALL=C join -v 2 - "$tmp/all-files"`
if test -n "$missed_files"; then
@example
void
re_set_registers (struct re_pattern_buffer *@var{buffer},
- struct re_registers *@var{regs},
- size_t @var{num_regs},
- regoff_t *@var{starts}, regoff_t *@var{ends})
+ struct re_registers *@var{regs},
+ size_t @var{num_regs},
+ regoff_t *@var{starts}, regoff_t *@var{ends})
@end example
@noindent sets @var{regs} to hold @var{num_regs} registers, storing
struct acl_entry *ace = &entries[i];
if (ace->uid != ACL_NSUSER && ace->gid != ACL_NSGROUP)
- return 1;
+ return 1;
}
return 0;
}
static void *
xpalloc (void *pa, ptrdiff_t *nitems, ptrdiff_t nitems_incr_min,
- ptrdiff_t nitems_max, ptrdiff_t item_size)
+ ptrdiff_t nitems_max, ptrdiff_t item_size)
{
ptrdiff_t n0 = *nitems;
*nitems = 0;
if (n - n0 < nitems_incr_min
&& (INT_ADD_WRAPV (n0, nitems_incr_min, &n)
- || (0 <= nitems_max && nitems_max < n)
- || INT_MULTIPLY_WRAPV (n, item_size, &nbytes)))
+ || (0 <= nitems_max && nitems_max < n)
+ || INT_MULTIPLY_WRAPV (n, item_size, &nbytes)))
xalloc_die ();
pa = xrealloc (pa, nbytes);
*nitems = n;
{
switch (*str++)
{
- case '.':
- case '{':
- case '}':
- case '(':
- case ')':
- if (options & EXCLUDE_REGEX)
- return true;
- break;
+ case '.':
+ case '{':
+ case '}':
+ case '(':
+ case ')':
+ if (options & EXCLUDE_REGEX)
+ return true;
+ break;
case '\\':
- if (options & EXCLUDE_REGEX)
- continue;
- else
- str += ! (options & FNM_NOESCAPE) && *str;
+ if (options & EXCLUDE_REGEX)
+ continue;
+ else
+ str += ! (options & FNM_NOESCAPE) && *str;
break;
case '+': case '@': case '!':
{
case exclude_pattern:
for (i = 0; i < seg->v.pat.exclude_count; i++)
- {
- if (seg->v.pat.exclude[i].options & EXCLUDE_REGEX)
- regfree (&seg->v.pat.exclude[i].v.re);
- }
+ {
+ if (seg->v.pat.exclude[i].options & EXCLUDE_REGEX)
+ regfree (&seg->v.pat.exclude[i].v.re);
+ }
free (seg->v.pat.exclude);
break;
if (! (options & EXCLUDE_ANCHORED))
for (p = f; *p && ! matched; p++)
if (*p == '/' && p[1] != '/')
- matched = ((*matcher) (pattern, p + 1, options) == 0);
+ matched = ((*matcher) (pattern, p + 1, options) == 0);
return matched;
}
&& fnmatch_pattern_has_wildcards (pattern, options))
{
if (! (ex->head && ex->head->type == exclude_pattern
- && ((ex->head->options & EXCLUDE_INCLUDE)
- == (options & EXCLUDE_INCLUDE))))
- new_exclude_segment (ex, exclude_pattern, options);
+ && ((ex->head->options & EXCLUDE_INCLUDE)
+ == (options & EXCLUDE_INCLUDE))))
+ new_exclude_segment (ex, exclude_pattern, options);
seg = ex->head;
patopts->options = options;
if (options & EXCLUDE_REGEX)
- {
- int rc;
- int cflags = REG_NOSUB|REG_EXTENDED|
- ((options & FNM_CASEFOLD) ? REG_ICASE : 0);
-
- if (options & FNM_LEADING_DIR)
- {
- char *tmp;
- size_t len = strlen (pattern);
-
- while (len > 0 && ISSLASH (pattern[len-1]))
- --len;
-
- if (len == 0)
- rc = 1;
- else
- {
- tmp = xmalloc (len + 7);
- memcpy (tmp, pattern, len);
- strcpy (tmp + len, "(/.*)?");
- rc = regcomp (&patopts->v.re, tmp, cflags);
- free (tmp);
- }
- }
- else
- rc = regcomp (&patopts->v.re, pattern, cflags);
-
- if (rc)
- {
- pat->exclude_count--;
- return;
- }
- }
+ {
+ int rc;
+ int cflags = REG_NOSUB|REG_EXTENDED|
+ ((options & FNM_CASEFOLD) ? REG_ICASE : 0);
+
+ if (options & FNM_LEADING_DIR)
+ {
+ char *tmp;
+ size_t len = strlen (pattern);
+
+ while (len > 0 && ISSLASH (pattern[len-1]))
+ --len;
+
+ if (len == 0)
+ rc = 1;
+ else
+ {
+ tmp = xmalloc (len + 7);
+ memcpy (tmp, pattern, len);
+ strcpy (tmp + len, "(/.*)?");
+ rc = regcomp (&patopts->v.re, tmp, cflags);
+ free (tmp);
+ }
+ }
+ else
+ rc = regcomp (&patopts->v.re, pattern, cflags);
+
+ if (rc)
+ {
+ pat->exclude_count--;
+ return;
+ }
+ }
else
- {
- if (options & EXCLUDE_ALLOC)
- {
- pattern = xstrdup (pattern);
- exclude_add_pattern_buffer (ex, (char*) pattern);
- }
- patopts->v.pattern = pattern;
- }
+ {
+ if (options & EXCLUDE_ALLOC)
+ {
+ pattern = xstrdup (pattern);
+ exclude_add_pattern_buffer (ex, (char*) pattern);
+ }
+ patopts->v.pattern = pattern;
+ }
}
else
{
int
add_exclude_fp (void (*add_func) (struct exclude *, char const *, int, void *),
- struct exclude *ex, FILE *fp, int options,
- char line_end,
- void *data)
+ struct exclude *ex, FILE *fp, int options,
+ char line_end,
+ void *data)
{
char *buf = NULL;
char *p;
int
add_exclude_file (void (*add_func) (struct exclude *, char const *, int),
- struct exclude *ex, char const *file_name, int options,
- char line_end)
+ struct exclude *ex, char const *file_name, int options,
+ char line_end)
{
bool use_stdin = file_name[0] == '-' && !file_name[1];
FILE *in;
int add_exclude_file (void (*) (struct exclude *, char const *, int),
struct exclude *, char const *, int, char);
int add_exclude_fp (void (*) (struct exclude *, char const *, int, void *),
- struct exclude *, FILE *, int, char, void *);
+ struct exclude *, FILE *, int, char, void *);
bool excluded_file_name (struct exclude const *, char const *);
void exclude_add_pattern_buffer (struct exclude *ex, char *buf);
bool exclude_fnmatch (char const *, char const *, int);
int
get_permissions (const char *name, int desc, mode_t mode,
- struct permission_context *ctx)
+ struct permission_context *ctx)
{
memset (ctx, 0, sizeof *ctx);
ctx->mode = mode;
{
ctx->default_acl = acl_get_file (name, ACL_TYPE_DEFAULT);
if (ctx->default_acl == NULL)
- return -1;
+ return -1;
}
# if HAVE_ACL_TYPE_NFS4 /* FreeBSD */
int ret;
if (desc != -1)
- ret = facl (desc, ACE_GETACLCNT, 0, NULL);
+ ret = facl (desc, ACE_GETACLCNT, 0, NULL);
else
- ret = acl (name, ACE_GETACLCNT, 0, NULL);
+ ret = acl (name, ACE_GETACLCNT, 0, NULL);
if (ret < 0)
- {
- if (errno == ENOSYS || errno == EINVAL)
- ret = 0;
- else
- return -1;
- }
+ {
+ if (errno == ENOSYS || errno == EINVAL)
+ ret = 0;
+ else
+ return -1;
+ }
ctx->ace_count = ret;
if (ctx->ace_count == 0)
}
if (desc != -1)
- ret = facl (desc, ACE_GETACL, ctx->ace_count, ctx->ace_entries);
+ ret = facl (desc, ACE_GETACL, ctx->ace_count, ctx->ace_entries);
else
- ret = acl (name, ACE_GETACL, ctx->ace_count, ctx->ace_entries);
+ ret = acl (name, ACE_GETACL, ctx->ace_count, ctx->ace_entries);
if (ret < 0)
{
if (errno == ENOSYS || errno == EINVAL)
{
- free (ctx->ace_entries);
- ctx->ace_entries = NULL;
+ free (ctx->ace_entries);
+ ctx->ace_entries = NULL;
ctx->ace_count = 0;
break;
}
return -1;
}
if (ret <= ctx->ace_count)
- {
- ctx->ace_count = ret;
- break;
- }
+ {
+ ctx->ace_count = ret;
+ break;
+ }
/* Huh? The number of ACL entries has increased since the last call.
Repeat. */
free (ctx->ace_entries);
int ret;
if (desc != -1)
- ret = facl (desc, GETACLCNT, 0, NULL);
+ ret = facl (desc, GETACLCNT, 0, NULL);
else
- ret = acl (name, GETACLCNT, 0, NULL);
+ ret = acl (name, GETACLCNT, 0, NULL);
if (ret < 0)
- {
- if (errno == ENOSYS || errno == ENOTSUP || errno == EOPNOTSUPP)
- ret = 0;
- else
- return -1;
- }
+ {
+ if (errno == ENOSYS || errno == ENOTSUP || errno == EOPNOTSUPP)
+ ret = 0;
+ else
+ return -1;
+ }
ctx->count = ret;
if (ctx->count == 0)
- break;
+ break;
ctx->entries = (aclent_t *) malloc (ctx->count * sizeof (aclent_t));
if (ctx->entries == NULL)
}
if (desc != -1)
- ret = facl (desc, GETACL, ctx->count, ctx->entries);
+ ret = facl (desc, GETACL, ctx->count, ctx->entries);
else
- ret = acl (name, GETACL, ctx->count, ctx->entries);
+ ret = acl (name, GETACL, ctx->count, ctx->entries);
if (ret < 0)
- {
- if (errno == ENOSYS || errno == ENOTSUP || errno == EOPNOTSUPP)
- {
- free (ctx->entries);
- ctx->entries = NULL;
- ctx->count = 0;
- break;
- }
- else
- return -1;
- }
+ {
+ if (errno == ENOSYS || errno == ENOTSUP || errno == EOPNOTSUPP)
+ {
+ free (ctx->entries);
+ ctx->entries = NULL;
+ ctx->count = 0;
+ break;
+ }
+ else
+ return -1;
+ }
if (ret <= ctx->count)
- {
- ctx->count = ret;
- break;
- }
+ {
+ ctx->count = ret;
+ break;
+ }
/* Huh? The number of ACL entries has increased since the last call.
Repeat. */
free (ctx->entries);
if (kernel32 != NULL)
{
GetSystemTimePreciseAsFileTimeFunc =
- (GetSystemTimePreciseAsFileTimeFuncType) GetProcAddress (kernel32, "GetSystemTimePreciseAsFileTime");
+ (GetSystemTimePreciseAsFileTimeFuncType) GetProcAddress (kernel32, "GetSystemTimePreciseAsFileTime");
}
initialized = TRUE;
}
if (pc->local_zones_seen && !pc->debug_local_zones_seen)
{
fprintf (stderr, &" isdst=%d%s"[!space],
- pc->local_isdst, pc->dsts_seen ? " DST" : "");
+ pc->local_isdst, pc->dsts_seen ? " DST" : "");
pc->debug_local_zones_seen = true;
space = true;
}
fprintf (stderr, ", dst");
if (pc.zones_seen)
- fprintf (stderr, " (%s)", time_zone_str (pc.time_zone, time_zone_buf));
+ fprintf (stderr, " (%s)", time_zone_str (pc.time_zone, time_zone_buf));
fputc ('\n', stderr);
}
int
rpl_pselect (int nfds, fd_set *restrict rfds,
- fd_set *restrict wfds, fd_set *restrict xfds,
+ fd_set *restrict wfds, fd_set *restrict xfds,
struct timespec const *restrict timeout,
- sigset_t const *restrict sigmask)
+ sigset_t const *restrict sigmask)
{
int i;
if (ret < 0 && errno != EINVAL && errno != ENOTSUP)
{
if (errno == ENOSYS)
- {
- *must_chmod = true;
- return 0;
- }
+ {
+ *must_chmod = true;
+ return 0;
+ }
return -1;
}
if (ret == 0)
- return 0;
+ return 0;
}
# endif
if (desc != -1)
ret = facl (desc, SETACL,
- sizeof (entries) / sizeof (aclent_t), entries);
+ sizeof (entries) / sizeof (aclent_t), entries);
else
ret = acl (name, SETACL,
- sizeof (entries) / sizeof (aclent_t), entries);
+ sizeof (entries) / sizeof (aclent_t), entries);
if (ret < 0)
{
- if (errno == ENOSYS || errno == EOPNOTSUPP)
- {
- *must_chmod = true;
- return 0;
- }
- return -1;
+ if (errno == ENOSYS || errno == EOPNOTSUPP)
+ {
+ *must_chmod = true;
+ return 0;
+ }
+ return -1;
}
return 0;
}
static int
set_acls (struct permission_context *ctx, const char *name, int desc,
- int from_mode, bool *must_chmod, bool *acls_set)
+ int from_mode, bool *must_chmod, bool *acls_set)
{
int ret = 0;
if (! ctx->acls_not_supported)
{
if (ret == 0 && from_mode)
- {
- if (ctx->acl)
- acl_free (ctx->acl);
- ctx->acl = acl_from_mode (ctx->mode);
- if (ctx->acl == NULL)
- ret = -1;
- }
+ {
+ if (ctx->acl)
+ acl_free (ctx->acl);
+ ctx->acl = acl_from_mode (ctx->mode);
+ if (ctx->acl == NULL)
+ ret = -1;
+ }
if (ret == 0 && ctx->acl)
- {
- if (HAVE_ACL_SET_FD && desc != -1)
- ret = acl_set_fd (desc, ctx->acl);
- else
- ret = acl_set_file (name, ACL_TYPE_ACCESS, ctx->acl);
- if (ret != 0)
- {
- if (! acl_errno_valid (errno))
- {
- ctx->acls_not_supported = true;
- if (from_mode || acl_access_nontrivial (ctx->acl) == 0)
- ret = 0;
- }
- }
- else
- {
- *acls_set = true;
- if (S_ISDIR(ctx->mode))
- {
- if (! from_mode && ctx->default_acl &&
- acl_default_nontrivial (ctx->default_acl))
- ret = acl_set_file (name, ACL_TYPE_DEFAULT,
- ctx->default_acl);
- else
- ret = acl_delete_def_file (name);
- }
- }
- }
+ {
+ if (HAVE_ACL_SET_FD && desc != -1)
+ ret = acl_set_fd (desc, ctx->acl);
+ else
+ ret = acl_set_file (name, ACL_TYPE_ACCESS, ctx->acl);
+ if (ret != 0)
+ {
+ if (! acl_errno_valid (errno))
+ {
+ ctx->acls_not_supported = true;
+ if (from_mode || acl_access_nontrivial (ctx->acl) == 0)
+ ret = 0;
+ }
+ }
+ else
+ {
+ *acls_set = true;
+ if (S_ISDIR(ctx->mode))
+ {
+ if (! from_mode && ctx->default_acl &&
+ acl_default_nontrivial (ctx->default_acl))
+ ret = acl_set_file (name, ACL_TYPE_DEFAULT,
+ ctx->default_acl);
+ else
+ ret = acl_delete_def_file (name);
+ }
+ }
+ }
}
# if HAVE_ACL_TYPE_NFS4 /* FreeBSD */
/* Remove ACLs if the file has ACLs. */
if (HAVE_ACL_GET_FD && desc != -1)
- acl = acl_get_fd (desc);
+ acl = acl_get_fd (desc);
else
- acl = acl_get_file (name, ACL_TYPE_EXTENDED);
+ acl = acl_get_file (name, ACL_TYPE_EXTENDED);
if (acl)
- {
- acl_free (acl);
-
- acl = acl_init (0);
- if (acl)
- {
- if (HAVE_ACL_SET_FD && desc != -1)
- ret = acl_set_fd (desc, acl);
- else
- ret = acl_set_file (name, ACL_TYPE_EXTENDED, acl);
- acl_free (acl);
- }
- else
- ret = -1;
- }
+ {
+ acl_free (acl);
+
+ acl = acl_init (0);
+ if (acl)
+ {
+ if (HAVE_ACL_SET_FD && desc != -1)
+ ret = acl_set_fd (desc, acl);
+ else
+ ret = acl_set_file (name, ACL_TYPE_EXTENDED, acl);
+ acl_free (acl);
+ }
+ else
+ ret = -1;
+ }
}
else
{
if (HAVE_ACL_SET_FD && desc != -1)
- ret = acl_set_fd (desc, ctx->acl);
+ ret = acl_set_fd (desc, ctx->acl);
else
- ret = acl_set_file (name, ACL_TYPE_EXTENDED, ctx->acl);
+ ret = acl_set_file (name, ACL_TYPE_EXTENDED, ctx->acl);
if (ret != 0)
- {
- if (! acl_errno_valid (errno)
- && ! acl_extended_nontrivial (ctx->acl))
- ret = 0;
- }
+ {
+ if (! acl_errno_valid (errno)
+ && ! acl_extended_nontrivial (ctx->acl))
+ ret = 0;
+ }
}
*acls_set = true;
if (ret == 0 && ctx->count)
{
if (desc != -1)
- ret = facl (desc, SETACL, ctx->count, ctx->entries);
+ ret = facl (desc, SETACL, ctx->count, ctx->entries);
else
- ret = acl (name, SETACL, ctx->count, ctx->entries);
+ ret = acl (name, SETACL, ctx->count, ctx->entries);
if (ret < 0)
- {
- if ((errno == ENOSYS || errno == EOPNOTSUPP || errno == EINVAL)
- && acl_nontrivial (ctx->count, ctx->entries) == 0)
- ret = 0;
- }
+ {
+ if ((errno == ENOSYS || errno == EOPNOTSUPP || errno == EINVAL)
+ && acl_nontrivial (ctx->count, ctx->entries) == 0)
+ ret = 0;
+ }
else
- *acls_set = true;
+ *acls_set = true;
}
# ifdef ACE_GETACL
if (ret == 0 && ctx->ace_count)
{
if (desc != -1)
- ret = facl (desc, ACE_SETACL, ctx->ace_count, ctx->ace_entries);
+ ret = facl (desc, ACE_SETACL, ctx->ace_count, ctx->ace_entries);
else
- ret = acl (name, ACE_SETACL, ctx->ace_count, ctx->ace_entries);
+ ret = acl (name, ACE_SETACL, ctx->ace_count, ctx->ace_entries);
if (ret < 0)
- {
- if ((errno == ENOSYS || errno == EINVAL || errno == ENOTSUP)
- && acl_ace_nontrivial (ctx->ace_count, ctx->ace_entries) == 0)
- ret = 0;
- }
+ {
+ if ((errno == ENOSYS || errno == EINVAL || errno == ENOTSUP)
+ && acl_ace_nontrivial (ctx->ace_count, ctx->ace_entries) == 0)
+ ret = 0;
+ }
else
- *acls_set = true;
+ *acls_set = true;
}
# endif
if (ret == 0 && ctx->count > 0)
{
if (desc != -1)
- ret = fsetacl (desc, ctx->count, ctx->entries);
+ ret = fsetacl (desc, ctx->count, ctx->entries);
else
- ret = setacl (name, ctx->count, ctx->entries);
+ ret = setacl (name, ctx->count, ctx->entries);
if (ret < 0)
- {
- if ((errno == ENOSYS || errno == EOPNOTSUPP || errno == ENOTSUP)
- && (from_mode || !acl_nontrivial (ctx->count, ctx->entries)))
- ret = 0;
- }
+ {
+ if ((errno == ENOSYS || errno == EOPNOTSUPP || errno == ENOTSUP)
+ && (from_mode || !acl_nontrivial (ctx->count, ctx->entries)))
+ ret = 0;
+ }
else
- *acls_set = true;
+ *acls_set = true;
}
# if HAVE_ACLV_H
{
ret = acl ((char *) name, ACL_SET, ctx->aclv_count, ctx->aclv_entries);
if (ret < 0)
- {
- if ((errno == ENOSYS || errno == EOPNOTSUPP || errno == EINVAL)
- && (from_mode || !aclv_nontrivial (ctx->aclv_count, ctx->aclv_entries)))
- ret = 0;
- }
+ {
+ if ((errno == ENOSYS || errno == EOPNOTSUPP || errno == EINVAL)
+ && (from_mode || !aclv_nontrivial (ctx->aclv_count, ctx->aclv_entries)))
+ ret = 0;
+ }
else
- *acls_set = true;
+ *acls_set = true;
}
# endif
if (ret == 0 && ctx->have_u)
{
if (desc != -1)
- ret = fchacl (desc, &ctx->u.a, ctx->u.a.acl_len);
+ ret = fchacl (desc, &ctx->u.a, ctx->u.a.acl_len);
else
- ret = chacl ((char *) name, &ctx->u.a, ctx->u.a.acl_len);
+ ret = chacl ((char *) name, &ctx->u.a, ctx->u.a.acl_len);
if (ret < 0)
- {
- if (errno == ENOSYS && from_mode)
- ret = 0;
- }
+ {
+ if (errno == ENOSYS && from_mode)
+ ret = 0;
+ }
else
- *acls_set = true;
+ *acls_set = true;
}
# elif HAVE_ACLSORT /* NonStop Kernel */
{
ret = acl ((char *) name, ACL_SET, ctx->count, ctx->entries);
if (ret != 0)
- {
- if (!acl_nontrivial (ctx->count, ctx->entries))
- ret = 0;
- }
+ {
+ if (!acl_nontrivial (ctx->count, ctx->entries))
+ ret = 0;
+ }
else
- *acls_set = true;
+ *acls_set = true;
}
# else /* No ACLs */
{
ret = chmod_or_fchmod (name, desc, ctx->mode);
if (ret != 0)
- return -1;
+ return -1;
}
#if USE_ACL
int saved_errno = ret ? errno : 0;
/* If we can't set an acl which we expect to be able to set, try setting
- the permissions to ctx->mode. Due to possible inherited permissions,
- we cannot simply chmod. */
+ the permissions to ctx->mode. Due to possible inherited permissions,
+ we cannot simply chmod. */
ret = set_acls (ctx, name, desc, true, &must_chmod, &acls_set);
if (! acls_set)
- must_chmod = true;
+ must_chmod = true;
if (saved_errno)
- {
- errno = saved_errno;
- ret = -1;
- }
+ {
+ errno = saved_errno;
+ ret = -1;
+ }
}
#endif
ret = chmod_or_fchmod (name, desc, ctx->mode);
if (saved_errno)
- {
- errno = saved_errno;
- ret = -1;
- }
+ {
+ errno = saved_errno;
+ ret = -1;
+ }
}
return ret;
# define localtime rpl_localtime
# endif
_GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer)
- _GL_ARG_NONNULL ((1)));
+ _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (localtime, struct tm *, (time_t const *__timer));
# else
_GL_CXXALIAS_SYS (localtime, struct tm *, (time_t const *__timer));
HAVE_REALPATH=0
else
case "$gl_cv_func_realpath_works" in
- *yes) ;;
- *) REPLACE_REALPATH=1 ;;
+ *yes) ;;
+ *) REPLACE_REALPATH=1 ;;
esac
fi
else
gl_good_gcrypt=no
m4_ifdef([AM_PATH_LIBGCRYPT],
[AM_PATH_LIBGCRYPT([1.4.4], [gl_good_gcrypt=yes],
- [AC_MSG_ERROR([libgcrypt is too old])])])
+ [AC_MSG_ERROR([libgcrypt is too old])])])
if test "x$gl_good_gcrypt" != xno; then
AC_LIB_HAVE_LINKFLAGS([gcrypt], [gpg-error], [#include <gcrypt.h>])
else
for ac_kw in __restrict __restrict__ _Restrict restrict; do
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
- [[typedef int *int_ptr;
- int foo (int_ptr $ac_kw ip) { return ip[0]; }
- int bar (int [$ac_kw]); /* Catch GCC bug 14050. */
- int bar (int ip[$ac_kw]) { return ip[0]; }
- ]],
- [[int s[1];
- int *$ac_kw t = s;
- t[0] = 0;
- return foo (t) + bar (t);
- ]])],
+ [[typedef int *int_ptr;
+ int foo (int_ptr $ac_kw ip) { return ip[0]; }
+ int bar (int [$ac_kw]); /* Catch GCC bug 14050. */
+ int bar (int ip[$ac_kw]) { return ip[0]; }
+ ]],
+ [[int s[1];
+ int *$ac_kw t = s;
+ t[0] = 0;
+ return foo (t) + bar (t);
+ ]])],
[ac_cv_c_restrict=$ac_kw])
test "$ac_cv_c_restrict" != no && break
done
case " $LIBS " in
*' -pthread '*) ;;
*' -lpthread '*) ;;
- *)
- AC_CACHE_CHECK([whether pthread_sigmask works without -lpthread],
- [gl_cv_func_pthread_sigmask_in_libc_works],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
- #include <pthread.h>
- #include <signal.h>
- #include <stddef.h>
- int main ()
- {
- sigset_t set;
- sigemptyset (&set);
- return pthread_sigmask (1729, &set, NULL) != 0;
- }]])],
- [gl_cv_func_pthread_sigmask_in_libc_works=no],
- [gl_cv_func_pthread_sigmask_in_libc_works=yes],
- [
- changequote(,)dnl
- case "$host_os" in
- freebsd* | hpux* | solaris | solaris2.[2-9]*)
- gl_cv_func_pthread_sigmask_in_libc_works="guessing no";;
- *)
- gl_cv_func_pthread_sigmask_in_libc_works="guessing yes";;
- esac
- changequote([,])dnl
- ])
- ])
- case "$gl_cv_func_pthread_sigmask_in_libc_works" in
- *no)
- REPLACE_PTHREAD_SIGMASK=1
- AC_DEFINE([PTHREAD_SIGMASK_INEFFECTIVE], [1],
- [Define to 1 if pthread_sigmask may return 0 and have no effect.])
- ;;
- esac;;
+ *)
+ AC_CACHE_CHECK([whether pthread_sigmask works without -lpthread],
+ [gl_cv_func_pthread_sigmask_in_libc_works],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+ #include <pthread.h>
+ #include <signal.h>
+ #include <stddef.h>
+ int main ()
+ {
+ sigset_t set;
+ sigemptyset (&set);
+ return pthread_sigmask (1729, &set, NULL) != 0;
+ }]])],
+ [gl_cv_func_pthread_sigmask_in_libc_works=no],
+ [gl_cv_func_pthread_sigmask_in_libc_works=yes],
+ [
+ changequote(,)dnl
+ case "$host_os" in
+ freebsd* | hpux* | solaris | solaris2.[2-9]*)
+ gl_cv_func_pthread_sigmask_in_libc_works="guessing no";;
+ *)
+ gl_cv_func_pthread_sigmask_in_libc_works="guessing yes";;
+ esac
+ changequote([,])dnl
+ ])
+ ])
+ case "$gl_cv_func_pthread_sigmask_in_libc_works" in
+ *no)
+ REPLACE_PTHREAD_SIGMASK=1
+ AC_DEFINE([PTHREAD_SIGMASK_INEFFECTIVE], [1],
+ [Define to 1 if pthread_sigmask may return 0 and have no effect.])
+ ;;
+ esac;;
esac
fi
ac_cv_c_vararrays,
[AC_EGREP_CPP([defined],
[#ifdef __STDC_NO_VLA__
- defined
- #endif
+ defined
+ #endif
],
[ac_cv_c_vararrays='no: __STDC_NO_VLA__ is defined'],
[AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[/* Test for VLA support. This test is partly inspired
- from examples in the C standard. Use at least two VLA
- functions to detect the GCC 3.4.3 bug described in:
- https://lists.gnu.org/r/bug-gnulib/2014-08/msg00014.html
- */
- #ifdef __STDC_NO_VLA__
- syntax error;
- #else
- extern int n;
- int B[100];
- int fvla (int m, int C[m][m]);
+ [AC_LANG_PROGRAM(
+ [[/* Test for VLA support. This test is partly inspired
+ from examples in the C standard. Use at least two VLA
+ functions to detect the GCC 3.4.3 bug described in:
+ https://lists.gnu.org/r/bug-gnulib/2014-08/msg00014.html
+ */
+ #ifdef __STDC_NO_VLA__
+ syntax error;
+ #else
+ extern int n;
+ int B[100];
+ int fvla (int m, int C[m][m]);
- int
- simple (int count, int all[static count])
- {
- return all[count - 1];
- }
+ int
+ simple (int count, int all[static count])
+ {
+ return all[count - 1];
+ }
- int
- fvla (int m, int C[m][m])
- {
- typedef int VLA[m][m];
- VLA x;
- int D[m];
- static int (*q)[m] = &B;
- int (*s)[n] = q;
- return C && &x[0][0] == &D[0] && &D[0] == s[0];
- }
- #endif
- ]])],
- [ac_cv_c_vararrays=yes],
- [ac_cv_c_vararrays=no])])])
+ int
+ fvla (int m, int C[m][m])
+ {
+ typedef int VLA[m][m];
+ VLA x;
+ int D[m];
+ static int (*q)[m] = &B;
+ int (*s)[n] = q;
+ return C && &x[0][0] == &D[0] && &D[0] == s[0];
+ }
+ #endif
+ ]])],
+ [ac_cv_c_vararrays=yes],
+ [ac_cv_c_vararrays=no])])])
if test "$ac_cv_c_vararrays" = yes; then
dnl This is for compatibility with Autoconf 2.61-2.69.
AC_DEFINE([HAVE_C_VARARRAYS], 1,
{
case 0: expected = expected_for_empty_file; break;
case 1: case 2: expected = expected_for_small_file; break;
- case 3: case 4: expected = expected_for_large_file; break;
+ case 3: case 4: expected = expected_for_large_file; break;
default: abort ();
}
/* Check that the various O_* macros are defined. */
int o = (O_DIRECT | O_DIRECTORY | O_DSYNC | O_IGNORE_CTTY | O_NDELAY | O_NOATIME
- | O_NONBLOCK | O_NOCTTY | O_NOFOLLOW | O_NOLINK | O_NOLINKS | O_NOTRANS
- | O_RSYNC | O_SYNC | O_TTY_INIT | O_BINARY | O_TEXT);
+ | O_NONBLOCK | O_NOCTTY | O_NOFOLLOW | O_NOLINK | O_NOLINKS | O_NOTRANS
+ | O_RSYNC | O_SYNC | O_TTY_INIT | O_BINARY | O_TEXT);
/* Check that the various SEEK_* macros are defined. */
int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
extremal (struct timespec a)
{
return ((a.tv_sec == TYPE_MINIMUM (time_t) && a.tv_nsec == 0)
- || (a.tv_sec == TYPE_MAXIMUM (time_t)
- && a.tv_nsec == TIMESPEC_RESOLUTION - 1));
+ || (a.tv_sec == TYPE_MAXIMUM (time_t)
+ && a.tv_nsec == TIMESPEC_RESOLUTION - 1));
}
int
{
int s = prototype[i].s;
if (TYPE_SIGNED (time_t) || 0 <= s)
- {
- time_t t = (s <= INT_MIN + 1 ? s - INT_MIN + TYPE_MINIMUM (time_t)
- : INT_MAX - 1 <= s ? s - INT_MAX + TYPE_MAXIMUM (time_t)
- : s);
- test[ntests++] = make_timespec (t, prototype[i].ns);
- }
+ {
+ time_t t = (s <= INT_MIN + 1 ? s - INT_MIN + TYPE_MINIMUM (time_t)
+ : INT_MAX - 1 <= s ? s - INT_MAX + TYPE_MAXIMUM (time_t)
+ : s);
+ test[ntests++] = make_timespec (t, prototype[i].ns);
+ }
}
for (i = 0; i < LOG10_TIMESPEC_RESOLUTION; i++)
ASSERT (sign (timespec_sign (a)) == cmp (a, make_timespec (0, 0)));
if (valid (a))
- for (j = 0; j < ntests; j++)
- {
- struct timespec b = test[j];
- if (valid (b))
- {
- struct timespec sum = timespec_add (a, b);
- struct timespec diff = timespec_sub (a, b);
- struct timespec rdiff = timespec_sub (b, a);
- ASSERT (cmp (a, b) == sign (i - j));
- ASSERT (eq (sum, timespec_add (b, a)));
- if (! extremal (sum))
- {
- ASSERT (eq (a, timespec_sub (sum, b)));
- ASSERT (eq (b, timespec_sub (sum, a)));
-
- for (k = 0; k < ntests; k++)
- {
- struct timespec c = test[k];
- if (valid (c))
- {
- struct timespec sumbc = timespec_add (b, c);
- if (! extremal (sumbc))
- ASSERT (eq (timespec_add (a, sumbc),
- timespec_add (sum, c)));
- }
- }
- }
- if (! extremal (diff))
- ASSERT (eq (a, timespec_add (diff, b)));
- if (! extremal (rdiff))
- ASSERT (eq (b, timespec_add (rdiff, a)));
-
- }
- }
+ for (j = 0; j < ntests; j++)
+ {
+ struct timespec b = test[j];
+ if (valid (b))
+ {
+ struct timespec sum = timespec_add (a, b);
+ struct timespec diff = timespec_sub (a, b);
+ struct timespec rdiff = timespec_sub (b, a);
+ ASSERT (cmp (a, b) == sign (i - j));
+ ASSERT (eq (sum, timespec_add (b, a)));
+ if (! extremal (sum))
+ {
+ ASSERT (eq (a, timespec_sub (sum, b)));
+ ASSERT (eq (b, timespec_sub (sum, a)));
+
+ for (k = 0; k < ntests; k++)
+ {
+ struct timespec c = test[k];
+ if (valid (c))
+ {
+ struct timespec sumbc = timespec_add (b, c);
+ if (! extremal (sumbc))
+ ASSERT (eq (timespec_add (a, sumbc),
+ timespec_add (sum, c)));
+ }
+ }
+ }
+ if (! extremal (diff))
+ ASSERT (eq (a, timespec_add (diff, b)));
+ if (! extremal (rdiff))
+ ASSERT (eq (b, timespec_add (rdiff, a)));
+
+ }
+ }
}
return 0;
p += strspn (p, " \t\r\n");
if (!strncmp (p, "\303\267" /* ÷ */, 2))
{
- breaks_expected[i] = 1;
+ breaks_expected[i] = 1;
p += 2;
}
else if (!strncmp (p, "\303\227" /* × */, 2))
{
- breaks_expected[i] = 0;
+ breaks_expected[i] = 0;
p += 2;
}
else
}
p += n;
- input[i] = next_int;
- }
+ input[i] = next_int;
+ }
p += strspn (p, " \t\r\n");
- i++;
+ i++;
}
while (*p != '\0');
/* u32_wordbreaks always set BREAKS[0] to 0. */
breaks[0] = breaks_expected[0] = 1;
if (memcmp (breaks, breaks_expected, i - 1) != 0)
- {
- int j;
-
- fprintf (stderr, "%s:%d: expected: ", filename, lineno);
- for (j = 0; j < i - 1; j++)
- {
- int input_wbp = uc_wordbreak_property (input[j]);
- fprintf (stderr, "%s U+%04X (%s) ",
- breaks_expected[j] == 1 ? "\303\267" : "\303\227",
- input[j], wordbreakproperty_to_string (input_wbp));
- }
- fprintf (stderr, "\n");
- fprintf (stderr, "%s:%d: actual: ", filename, lineno);
- for (j = 0; j < i - 1; j++)
- {
- int input_wbp = uc_wordbreak_property (input[j]);
- fprintf (stderr, "%s U+%04X (%s) ",
- breaks[j] == 1 ? "\303\267" : "\303\227",
- input[j], wordbreakproperty_to_string (input_wbp));
- }
- fprintf (stderr, "\n");
- exit_code = 1;
- }
+ {
+ int j;
+
+ fprintf (stderr, "%s:%d: expected: ", filename, lineno);
+ for (j = 0; j < i - 1; j++)
+ {
+ int input_wbp = uc_wordbreak_property (input[j]);
+ fprintf (stderr, "%s U+%04X (%s) ",
+ breaks_expected[j] == 1 ? "\303\267" : "\303\227",
+ input[j], wordbreakproperty_to_string (input_wbp));
+ }
+ fprintf (stderr, "\n");
+ fprintf (stderr, "%s:%d: actual: ", filename, lineno);
+ for (j = 0; j < i - 1; j++)
+ {
+ int input_wbp = uc_wordbreak_property (input[j]);
+ fprintf (stderr, "%s U+%04X (%s) ",
+ breaks[j] == 1 ? "\303\267" : "\303\227",
+ input[j], wordbreakproperty_to_string (input_wbp));
+ }
+ fprintf (stderr, "\n");
+ exit_code = 1;
+ }
}
return exit_code;