Update of /cvsroot/blob/blob/src/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv31736/src/lib
Modified Files:
generic_io.c
Log Message:
fix missing crlf
Index: generic_io.c
===================================================================
RCS file: /cvsroot/blob/blob/src/lib/generic_io.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- generic_io.c 21 Aug 2003 11:44:34 -0000 1.8
+++ generic_io.c 21 Aug 2003 12:47:10 -0000 1.9
@@ -59,6 +59,8 @@
# define DBGIO( x, io )
#endif
+#define ERR( x ) do { ret = x; goto DONE; } while (0)
+
/**********************************************************************
* Typen
@@ -246,20 +248,19 @@
dest_name, src_name, amount );
if ( !src_name || !dest_name )
- return -EINVAL;
+ ERR( -EINVAL );
src = io_get_byname( src_name );
if ( !src )
- return -EINVAL;
+ ERR( -EINVAL );
dest = io_get_byname( dest_name );
if ( !dest )
- return -EINVAL;
+ ERR( -EINVAL );
DBGIO( 5, src );
DBGIO( 5, dest );
-
if ( amount == 0 ) {
amount = io_get_size( src );
}
@@ -267,7 +268,7 @@
if ( amount > io_get_size( dest ) ) {
printf( "\n\nio_copy: src size (%d) > dest space (%d)!\n\n",
amount, io_get_size( dest ) );
- return -ETOOLONG; // -ENOSPC ;)
+ ERR( -ETOOLONG );
}
blocks = amount / 512 + (amount%512?1:0);
@@ -289,7 +290,7 @@
if ( ret ) {
DBG( 1, "\n%s: read failed at block %d (adr %p).\n",
__FUNCTION__, block, adr );
- return -EINVAL;
+ ERR( -EINVAL );
}
/* write to dest */
@@ -297,16 +298,17 @@
if ( ret ) {
DBG( 1, "\n%s: write failed at block %d (adr %p).\n",
__FUNCTION__, block, adr );
- return -EINVAL;
+ ERR( -EINVAL );
}
amount -= to_copy;
adr += to_copy;
}
+ ret = 0;
+DONE:
#if !defined(IO_QUIET)
printf("\n");
#endif
-
- return 0;
+ return ret;
}
|