X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fannosbr.c;h=d1e39b055729a2a86692b70f6f066051c7ceb57a;hp=99422e6b11ea80e0bf8776127cbc2c9299f2b6af;hb=88a0787554de9c618e657c31940e734178a25730;hpb=0a6e4d979566bc9eae772e37d2577bed1aacef92 diff --git a/uip/annosbr.c b/uip/annosbr.c index 99422e6..d1e39b0 100644 --- a/uip/annosbr.c +++ b/uip/annosbr.c @@ -19,18 +19,10 @@ */ 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; @@ -51,7 +43,7 @@ annotate(char *file, char *comp, char *text, int datesw, 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; @@ -59,7 +51,7 @@ annotate(char *file, char *comp, char *text, int datesw, 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); @@ -150,17 +142,6 @@ annolist(char *file, char *comp, char *text, int number) 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)