diff options
author | Werner Koch <wk@gnupg.org> | 1999-06-26 12:23:06 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 1999-06-26 12:23:06 +0200 |
commit | 080c9ca49f4d0b0aa07e00e1eb84bc39bf4c8562 (patch) | |
tree | 7d387cb3da17d9b3e25aef7f85acbad21f75be7f /util | |
parent | See ChangeLog: Wed Jun 16 20:16:21 CEST 1999 Werner Koch (diff) | |
download | gnupg2-080c9ca49f4d0b0aa07e00e1eb84bc39bf4c8562.tar.xz gnupg2-080c9ca49f4d0b0aa07e00e1eb84bc39bf4c8562.zip |
See ChangeLog: Sat Jun 26 12:15:59 CEST 1999 Werner Koch
Diffstat (limited to 'util')
-rw-r--r-- | util/ChangeLog | 13 | ||||
-rw-r--r-- | util/dotlock.c | 6 | ||||
-rw-r--r-- | util/iobuf.c | 24 | ||||
-rw-r--r-- | util/secmem.c | 5 |
4 files changed, 34 insertions, 14 deletions
diff --git a/util/ChangeLog b/util/ChangeLog index c11e42947..3435472c5 100644 --- a/util/ChangeLog +++ b/util/ChangeLog @@ -1,3 +1,16 @@ +Sat Jun 26 12:15:59 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> + + + * dotlock.c (create_dotlock): s/uts/utsbuf/ cause there an Amdahl + system with the name UTS (Dave Dykstra). + + * secmem.c (DEFAULT_POOLSIZE): Doubled the size. + +Fri Jun 18 00:18:02 CEST 1999 Michael Roth <mroth@nessie.de> + + * iobuf.c: file_filter() Detection of EOF on terminals + improved/fixed (see Bug #21). + Mon Jun 14 21:18:54 CEST 1999 Michael Roth <mroth@nessie.de> * ttyio.c: tty_no_terminal() new. diff --git a/util/dotlock.c b/util/dotlock.c index 18841ec56..644cf8e3a 100644 --- a/util/dotlock.c +++ b/util/dotlock.c @@ -74,7 +74,7 @@ create_dotlock( const char *file_to_lock ) int fd = -1; char pidstr[16]; #ifndef HAVE_DOSISH_SYSTEM - struct utsname uts; + struct utsname utsbuf; #endif const char *nodename; const char *dirpart; @@ -93,10 +93,10 @@ create_dotlock( const char *file_to_lock ) /* fixme: add the hostname to the second line (FQDN or IP addr?) */ /* create a temporary file */ - if( uname( &uts ) ) + if( uname( &utsbuf ) ) nodename = "unknown"; else - nodename = uts.nodename; + nodename = utsbuf.nodename; if( !(dirpart = strrchr( file_to_lock, '/' )) ) { dirpart = "."; diff --git a/util/iobuf.c b/util/iobuf.c index e5379d9ce..31dabace0 100644 --- a/util/iobuf.c +++ b/util/iobuf.c @@ -92,16 +92,22 @@ file_filter(void *opaque, int control, IOBUF chain, byte *buf, size_t *ret_len) if( control == IOBUFCTRL_UNDERFLOW ) { assert( size ); /* need a buffer */ - clearerr( fp ); - nbytes = fread( buf, 1, size, fp ); - if( feof(fp) && !nbytes ) - rc = -1; /* okay: we can return EOF now. */ - else if( ferror(fp) && errno != EPIPE ) { - log_error("%s: read error: %s\n", - a->fname, strerror(errno)); - rc = G10ERR_READ_FILE; + if ( feof(fp)) { /* On terminals you could easiely read as many EOFs as you call */ + rc = -1; /* fread() or fgetc() repeatly. Every call will block until you press */ + *ret_len = 0; /* CTRL-D. So we catch this case before we call fread() again. */ + } + else { + clearerr( fp ); + nbytes = fread( buf, 1, size, fp ); + if( feof(fp) && !nbytes ) + rc = -1; /* okay: we can return EOF now. */ + else if( ferror(fp) && errno != EPIPE ) { + log_error("%s: read error: %s\n", + a->fname, strerror(errno)); + rc = G10ERR_READ_FILE; + } + *ret_len = nbytes; } - *ret_len = nbytes; } else if( control == IOBUFCTRL_FLUSH ) { if( size ) { diff --git a/util/secmem.c b/util/secmem.c index f48b0edb0..8f7c428e4 100644 --- a/util/secmem.c +++ b/util/secmem.c @@ -40,7 +40,7 @@ #define MAP_ANONYMOUS MAP_ANON #endif -#define DEFAULT_POOLSIZE 8196 +#define DEFAULT_POOLSIZE 16384 typedef struct memblock_struct MEMBLOCK; struct memblock_struct { @@ -184,7 +184,7 @@ init_pool( size_t n) static void compress_pool(void) { - + /* fixme: we really should do this */ } void @@ -290,6 +290,7 @@ secmem_malloc( size_t size ) max_alloced = cur_alloced; if( cur_blocks > max_blocks ) max_blocks = cur_blocks; + return &mb->u.aligned.c; } |