Age | Commit message (Collapse) | Author |
|
touch, main): Use bool for booleans.
(main): Avoid integer overflow when given more than INT_MAX
options.
|
|
too few operands ("missing operand after `xxx'") or
too many operands ("extra operand `xxx'").
Include "quote.h" and/or "error.h" if it wasn't already being included.
|
|
|
|
for access and one for modification.
(ref_stats): Remove.
(get_reldate): Use get_date's parameter profile.
(touch, main): Adjust to above changes.
(main): Work even if tm_year == INT_MAX (so long as long int is wider).
Use gettime instead of gettimeofday, for new get_date signature.
|
|
(err): Now a boolean int, not a counter,
so that we don't have to worry about int overflow. All uses changed.
|
|
(get_reldate): New function.
(main): Use it, to implement this new behavior.
|
|
of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
Update the call to parse_long_options so that `AUTHORS, NULL' are the
last parameters.
* src/true.c (main): Append NULL to version_etc argument list.
* src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
|
|
Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
Mark each WRITTEN_BY string as translatable.
|
|
|
|
the call to parse_long_options so that `AUTHORS, NULL' are the last parameters.
|
|
Set file timestamps with utimens, not utime.
|
|
|
|
Moved to system.h.
|
|
|
|
that it makes sense both when the file exists and when it doesn't.
|
|
|
|
|
|
`exit (1)' to `exit (EXIT_FAILURE)', and
`usage (1)' to `usage (EXIT_FAILURE)'.
|
|
|
|
Remove unnecessary initialization.
Use localtime, not posixtm, to warn about obsolete "touch".
|
|
|
|
when --no-create is in effect. Based on a patch from TAKAI Kousuke.
|
|
(usage): Document only the intersection of the old and new behaviors,
to encourage portability.
(main): Use `posix2_version ()' in place of POSIX2_VERSION.
|
|
|
|
support of the obsolete `touch [-acm] MMDDhhmm[YY] FILE...' syntax.
(usage, main): Implement this.
|
|
that they indicate a failure.
s/getting attributes/failed to get attributes/
|
|
instead of hard-coding --help and --version descriptions.
|
|
systems for which errno is set to EPERM in that case. Thus, e.g.,
`touch /' by non-root gives a better diagnostic on systems like SunOS4.
|
|
for short options too.''
|
|
Use fputs, not printf.
|
|
|
|
(touch): Give a better diagnostic for e.g., `touch /' by non-root.
Based on a patch from Michael Stone.
Reported by Jeff Sheinberg as Debian bug #101677.
|
|
help2man recognizes it as such.
|
|
digits as a file name, rather than as a date/time in the obsolescent
`MMDDhhmm[YY]' format. Reported by Wenjun Zheng.
|
|
|
|
corresponding argument in a `quote (...)' call.
Add more precise diagnostics.
|
|
|
|
(touch): Add O_NOCTTY to the flags passed to open.
|
|
(O_NONBLOCK): Define to O_NDELAY if not defined.
(touch): Open with O_NONBLOCK, so one can touch a fifo without hanging.
Reported by Eric G. Miller via Michael Stone.
|
|
(longopts): ...use it here instead of `CHAR_MAX + 1'.
(main): Likewise.
|
|
unwritable directory.
(touch): Record errno upon failed errno and use that
saved value if a subsequent fstat, stat or utime call fails.
Reported by Wichert Akkerman via Michael Stone.
|
|
of separate valid_fd variable.
|
|
an existing file. This makes it so that touching a read-only
file now works. Also clean up and simplify.
Based on a patch from Chip Salzenberg.
|
|
(open_maybe_create): Remove.
(touch): Don't record whether the file was created; this isn't
possible to do reliably and portably without race conditions.
If the file was created and if amtime_now is nonzero, this
change means we'll have to do another utime system call, but
that's no more harmful than the previous version of this code.
|
|
From Karl Heuer.
|
|
|
|
FILE is a directory. Reported by Vin Shelton.
|
|
Resort to calling stat for directories, but only when necessary.
(usage): Mention --no-create.
|
|
guaranteed to be portable.
|
|
(touch): Rewrite not to use `creat' and to eliminate a race
condition that could make touch truncate a nonempty file.
Report and suggestions from Andrew Tridgell.
|