*/
static int annosbr(int, char *, char *, char *, int, int, int);
-/*
-** This "local" global and the annopreserve() function are a hack that
-** allows additional functionality to be added to anno without piling
-** on yet another annotate() argument.
-*/
-
-/* set to preserve access and modification times on annotated message */
-static int preserve_actime_and_modtime = 0;
int
annotate(char *file, char *comp, char *text, int datesw,
- int delete, int append)
+ int delete, int append, int preserve)
{
int i, fd;
struct utimbuf b;
if (stat(file, &s) == -1) {
advise("can't get access and modification times for %s", file);
- preserve_actime_and_modtime = 0;
+ preserve = 0;
}
b.actime = s.st_atime;
i = annosbr(fd, file, comp, text, datesw, delete, append);
- if (preserve_actime_and_modtime && utime(file, &b) == -1)
+ if (preserve && utime(file, &b) == -1)
advise("can't set access and modification times for %s", file);
lkclose(fd, file);
return;
}
-/*
-** Set the preserve-times flag. This hack eliminates the need for an
-** additional argument to annotate().
-*/
-void
-annopreserve(int preserve)
-{
- preserve_actime_and_modtime = preserve;
- return;
-}
-
static int
annosbr(int fd, char *file, char *comp, char *text, int datesw, int delete,
int append)