[Libsysio-commit] HEAD: libsysio/include sysio.h
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2004-04-28 10:53:13
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17693 Modified Files: sysio.h Log Message: Work on SYSIO_INTERFACE_{DISPLAY_BLOCK,ENTER,RETURN}: + Cleaned up to parse correctly when expressions are used as args + Formatted to match *most* of the current style + RETURN now *sets* errno on error instead of simply restoring on no error. Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -w -b -B -p -r1.20 -r1.21 --- sysio.h 27 Apr 2004 22:13:01 -0000 1.20 +++ sysio.h 28 Apr 2004 10:53:01 -0000 1.21 @@ -352,6 +352,15 @@ extern int SYSIO_INTERFACE_NAME(umount)( /* * SYSIO interface frame macros + * + * + DISPLAY_BLOCK; Allocates storage on the stack for use by the set of + * macros. + * + ENTER; Performs entry point work + * + RETURN; Returns a value and performs exit point work + * + * NB: For RETURN, the arguments are the return value and value for errno. + * If the value for errno is non-zero then that value, *negated*, is set + * into errno. */ #define SYSIO_INTERFACE_DISPLAY_BLOCK \ int _saved_errno; @@ -363,7 +372,7 @@ extern int SYSIO_INTERFACE_NAME(umount)( #define SYSIO_INTERFACE_RETURN(rtn, err) \ do { \ SYSIO_LEAVE; \ - if (err == 0) errno = _saved_errno; \ + errno = (err) ? -(err) : _saved_errno; \ return (rtn); \ } while(0) |