From 00853b8a1aa5c4ff8bb10d99e65db52b06f639bf Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Fri, 15 Apr 2005 09:04:43 +0000 Subject: 2005-04-15 Marcus Brinkmann * symcryptrun.c (TEMP_FAILURE_RETRY): Define if not defined. --- tools/ChangeLog | 2 ++ tools/symcryptrun.c | 15 +++++++++++++++ 2 files changed, 17 insertions(+) (limited to 'tools') diff --git a/tools/ChangeLog b/tools/ChangeLog index 981c52f6b..62a5e841c 100644 --- a/tools/ChangeLog +++ b/tools/ChangeLog @@ -1,5 +1,7 @@ 2005-04-15 Marcus Brinkmann + * symcryptrun.c (TEMP_FAILURE_RETRY): Define if not defined. + * symcryptrun.c (remove_file): New function. (confucius_copy_file): Accept new argument PLAIN and shred the file if it is set on error. diff --git a/tools/symcryptrun.c b/tools/symcryptrun.c index 9f3a55f8b..b35e4d7a5 100644 --- a/tools/symcryptrun.c +++ b/tools/symcryptrun.c @@ -217,6 +217,21 @@ i18n_init(void) } +/* This is in the GNU C library in unistd.h. */ + +#ifndef TEMP_FAILURE_RETRY +/* Evaluate EXPRESSION, and repeat as long as it returns -1 with `errno' + set to EINTR. */ + +# define TEMP_FAILURE_RETRY(expression) \ + (__extension__ \ + ({ long int __result; \ + do __result = (long int) (expression); \ + while (__result == -1L && errno == EINTR); \ + __result; })) +#endif + + /* Unlink a file, and shred it if SHRED is true. */ int remove_file (char *name, int shred) -- cgit v1.2.3