summaryrefslogtreecommitdiff
path: root/plugins/MirOTR/libgcrypt-1.4.6/random/rndegd.c
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-02 20:55:18 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-02 20:55:18 +0000
commit78c0815c4118fe24ab78cce2dc48a6232dcd824a (patch)
tree8512c50df70b8dd80c919e88ade3419207c95956 /plugins/MirOTR/libgcrypt-1.4.6/random/rndegd.c
parentce816d83a8c75808e0eb06832592bffefe4a8dc4 (diff)
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirOTR/libgcrypt-1.4.6/random/rndegd.c')
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/random/rndegd.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/random/rndegd.c b/plugins/MirOTR/libgcrypt-1.4.6/random/rndegd.c
index 63a5e0f162..ba82a52616 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/random/rndegd.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/random/rndegd.c
@@ -58,7 +58,7 @@ my_make_filename (const char *first_part, const char *second_part)
n += strlen (second_part) + 1;
home = NULL;
- if( *first_part == '~' && first_part[1] == '/'
+ if ( *first_part == '~' && first_part[1] == '/'
&& (home = getenv("HOME")) && *home )
n += strlen(home);
@@ -83,9 +83,9 @@ do_write( int fd, void *buf, size_t nbytes )
while( nleft > 0 )
{
nwritten = write( fd, buf, nleft);
- if( nwritten < 0 )
+ if ( nwritten < 0 )
{
- if( errno == EINTR )
+ if ( errno == EINTR )
continue;
return -1;
}
@@ -107,9 +107,9 @@ do_read( int fd, void *buf, size_t nbytes )
n = read(fd, (char*)buf + nread, nbytes );
}
while( n == -1 && errno == EINTR );
- if( n == -1)
+ if ( n == -1)
return nread? nread:-1;
- if( n == 0)
+ if ( n == 0)
return -1;
nread += n;
nbytes -= n;
@@ -221,9 +221,9 @@ _gcry_rndegd_gather_random (void (*add)(const void*, size_t,
int nbytes;
int do_restart = 0;
- if( !length )
+ if ( !length )
return 0;
- if( !level )
+ if ( !level )
return 0;
restart:
@@ -236,20 +236,20 @@ _gcry_rndegd_gather_random (void (*add)(const void*, size_t,
/* First time we do it with a non blocking request */
buffer[0] = 1; /* non blocking */
buffer[1] = nbytes;
- if( do_write( fd, buffer, 2 ) == -1 )
+ if ( do_write( fd, buffer, 2 ) == -1 )
log_fatal("can't write to the EGD: %s\n", strerror(errno) );
n = do_read( fd, buffer, 1 );
- if( n == -1 )
+ if ( n == -1 )
{
log_error("read error on EGD: %s\n", strerror(errno));
do_restart = 1;
goto restart;
}
n = buffer[0];
- if( n )
+ if ( n )
{
n = do_read( fd, buffer, n );
- if( n == -1 )
+ if ( n == -1 )
{
log_error("read error on EGD: %s\n", strerror(errno));
do_restart = 1;
@@ -259,7 +259,7 @@ _gcry_rndegd_gather_random (void (*add)(const void*, size_t,
length -= n;
}
- if( length )
+ if ( length )
{
log_info (
_("Please wait, entropy is being gathered. Do some work if it would\n"
@@ -272,10 +272,10 @@ _gcry_rndegd_gather_random (void (*add)(const void*, size_t,
buffer[0] = 2; /* blocking */
buffer[1] = nbytes;
- if( do_write( fd, buffer, 2 ) == -1 )
+ if ( do_write( fd, buffer, 2 ) == -1 )
log_fatal("can't write to the EGD: %s\n", strerror(errno) );
n = do_read( fd, buffer, nbytes );
- if( n == -1 )
+ if ( n == -1 )
{
log_error("read error on EGD: %s\n", strerror(errno));
do_restart = 1;