summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-02-20 16:06:20 +0000
committerJim Meyering <jim@meyering.net>2002-02-20 16:06:20 +0000
commit69e21274854c69662b92865912d8ec9d5c82e864 (patch)
tree937384410b50c812dc451003f5123e59b3167c7b /src
parent12756a214ff3a6b3397a8343219e678ef9a74801 (diff)
downloadcoreutils-69e21274854c69662b92865912d8ec9d5c82e864.tar.xz
Include posixver.h.
(usage): Document only the intersection of the old and new behaviors, to encourage portability. (main): Use `posix2_version ()' in place of POSIX2_VERSION.
Diffstat (limited to 'src')
-rw-r--r--src/touch.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/touch.c b/src/touch.c
index e4666f03f..9ede5dd1e 100644
--- a/src/touch.c
+++ b/src/touch.c
@@ -28,6 +28,7 @@
#include "error.h"
#include "getdate.h"
#include "posixtm.h"
+#include "posixver.h"
#include "quote.h"
#include "safe-read.h"
@@ -226,9 +227,6 @@ usage (int status)
else
{
printf (_("Usage: %s [OPTION]... FILE...\n"), program_name);
- if (POSIX2_VERSION < 200112)
- printf (_(" or: %s [-acm] MMDDhhmm[YY] FILE... (obsolete)\n"),
- program_name);
fputs (_("\
Update the access and modification times of each FILE to the current time.\n\
\n\
@@ -255,10 +253,6 @@ Mandatory arguments to long options are mandatory for short options too.\n\
\n\
Note that the -d and -t options accept different time-date formats.\n\
"), stdout);
- if (POSIX2_VERSION < 200112)
- fputs (_("\
-Also, the obsolete time-date format differs from both other formats.\n\
-"), stdout);
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}
exit (status);
@@ -358,8 +352,8 @@ main (int argc, char **argv)
/* The obsolete `MMDDhhmm[YY]' form is valid IFF there are
two or more non-option arguments. */
- if (POSIX2_VERSION < 200112
- && !date_set && 2 <= argc - optind && !STREQ (argv[optind - 1], "--"))
+ if (!date_set && 2 <= argc - optind && !STREQ (argv[optind - 1], "--")
+ && posix2_version () < 200112)
{
newtime = posixtime (argv[optind], PDS_TRAILING_YEAR);
if (newtime != (time_t) -1)