Changeset d4651e4 in rtems
- Timestamp:
- Jan 4, 2002, 6:25:27 PM (19 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- e180a77e
- Parents:
- 3cb43d3
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/libnetworking/ChangeLog
r3cb43d3 rd4651e4 1 2002-02-04 Ralf Corsepius <corsepiu@faw.uni-ulm.de> 2 3 * lib/tftpDriver.c: Remove set_errno_and_return_minus_one, include 4 <rtems/seterr.h>. 5 6 1 7 2001-12-18 Eric Norum <eric.norum@usask.ca> 2 8 -
c/src/exec/libnetworking/lib/tftpDriver.c
r3cb43d3 rd4651e4 26 26 #include <rtems/libio.h> 27 27 #include <rtems/libio_.h> 28 #include <rtems/seterr.h> 28 29 #include <rtems/rtems_bsdnet.h> 29 30 #include <sys/types.h> … … 31 32 #include <netinet/in.h> 32 33 #include <arpa/inet.h> 33 34 #ifndef set_errno_and_return_minus_one35 #define set_errno_and_return_minus_one( _error ) \36 do { errno = (_error); return -1; } while(0)37 #endif38 34 39 35 #ifdef RTEMS_TFTP_DRIVER_DEBUG … … 229 225 230 226 if (sc != RTEMS_SUCCESSFUL) 231 set_errno_and_return_minus_one( ENOMEM );227 rtems_set_errno_and_return_minus_one( ENOMEM ); 232 228 233 229 return 0; … … 432 428 { 433 429 pathloc->node_access = NULL; 434 set_errno_and_return_minus_one( EIO );430 rtems_set_errno_and_return_minus_one( EIO ); 435 431 } 436 432 … … 509 505 */ 510 506 if (flags & RTEMS_LIBIO_PERMS_RDWR) 511 set_errno_and_return_minus_one( EISDIR );507 rtems_set_errno_and_return_minus_one( EISDIR ); 512 508 if (isRelative) { 513 509 cp = malloc (strlen(pathloc->node_access)+strlen(pathname)+1); 514 510 if (cp == NULL) 515 set_errno_and_return_minus_one( ENOMEM );511 rtems_set_errno_and_return_minus_one( ENOMEM ); 516 512 strcpy (cp, pathloc->node_access); 517 513 strcat (cp, pathname); … … 520 516 cp = strdup (pathname); 521 517 if (cp == NULL) 522 set_errno_and_return_minus_one( ENOMEM );518 rtems_set_errno_and_return_minus_one( ENOMEM ); 523 519 } 524 520 fixPath (cp); … … 534 530 flags &= RTEMS_LIBIO_PERMS_READ | RTEMS_LIBIO_PERMS_WRITE; 535 531 if ((flags != RTEMS_LIBIO_PERMS_READ) && (flags != RTEMS_LIBIO_PERMS_WRITE) ) 536 set_errno_and_return_minus_one( EINVAL );532 rtems_set_errno_and_return_minus_one( EINVAL ); 537 533 return 0; 538 534 } … … 848 844 tp->blocknum++; 849 845 if (sendAck (tp) != 0) 850 set_errno_and_return_minus_one( EIO );846 rtems_set_errno_and_return_minus_one( EIO ); 851 847 break; 852 848 } 853 849 if (opcode == TFTP_OPCODE_ERROR) 854 set_errno_and_return_minus_one( tftpErrno (tp) );850 rtems_set_errno_and_return_minus_one( tftpErrno (tp) ); 855 851 } 856 852 … … 859 855 */ 860 856 if (++retryCount == IO_RETRY_LIMIT) 861 set_errno_and_return_minus_one( EIO );857 rtems_set_errno_and_return_minus_one( EIO ); 862 858 if (sendAck (tp) != 0) 863 set_errno_and_return_minus_one( EIO );859 rtems_set_errno_and_return_minus_one( EIO ); 864 860 } 865 861 } … … 978 974 if (e) { 979 975 tp->writing = 0; 980 set_errno_and_return_minus_one (e);976 rtems_set_errno_and_return_minus_one (e); 981 977 } 982 978 } -
c/src/libnetworking/ChangeLog
r3cb43d3 rd4651e4 1 2002-02-04 Ralf Corsepius <corsepiu@faw.uni-ulm.de> 2 3 * lib/tftpDriver.c: Remove set_errno_and_return_minus_one, include 4 <rtems/seterr.h>. 5 6 1 7 2001-12-18 Eric Norum <eric.norum@usask.ca> 2 8 -
c/src/libnetworking/lib/tftpDriver.c
r3cb43d3 rd4651e4 26 26 #include <rtems/libio.h> 27 27 #include <rtems/libio_.h> 28 #include <rtems/seterr.h> 28 29 #include <rtems/rtems_bsdnet.h> 29 30 #include <sys/types.h> … … 31 32 #include <netinet/in.h> 32 33 #include <arpa/inet.h> 33 34 #ifndef set_errno_and_return_minus_one35 #define set_errno_and_return_minus_one( _error ) \36 do { errno = (_error); return -1; } while(0)37 #endif38 34 39 35 #ifdef RTEMS_TFTP_DRIVER_DEBUG … … 229 225 230 226 if (sc != RTEMS_SUCCESSFUL) 231 set_errno_and_return_minus_one( ENOMEM );227 rtems_set_errno_and_return_minus_one( ENOMEM ); 232 228 233 229 return 0; … … 432 428 { 433 429 pathloc->node_access = NULL; 434 set_errno_and_return_minus_one( EIO );430 rtems_set_errno_and_return_minus_one( EIO ); 435 431 } 436 432 … … 509 505 */ 510 506 if (flags & RTEMS_LIBIO_PERMS_RDWR) 511 set_errno_and_return_minus_one( EISDIR );507 rtems_set_errno_and_return_minus_one( EISDIR ); 512 508 if (isRelative) { 513 509 cp = malloc (strlen(pathloc->node_access)+strlen(pathname)+1); 514 510 if (cp == NULL) 515 set_errno_and_return_minus_one( ENOMEM );511 rtems_set_errno_and_return_minus_one( ENOMEM ); 516 512 strcpy (cp, pathloc->node_access); 517 513 strcat (cp, pathname); … … 520 516 cp = strdup (pathname); 521 517 if (cp == NULL) 522 set_errno_and_return_minus_one( ENOMEM );518 rtems_set_errno_and_return_minus_one( ENOMEM ); 523 519 } 524 520 fixPath (cp); … … 534 530 flags &= RTEMS_LIBIO_PERMS_READ | RTEMS_LIBIO_PERMS_WRITE; 535 531 if ((flags != RTEMS_LIBIO_PERMS_READ) && (flags != RTEMS_LIBIO_PERMS_WRITE) ) 536 set_errno_and_return_minus_one( EINVAL );532 rtems_set_errno_and_return_minus_one( EINVAL ); 537 533 return 0; 538 534 } … … 848 844 tp->blocknum++; 849 845 if (sendAck (tp) != 0) 850 set_errno_and_return_minus_one( EIO );846 rtems_set_errno_and_return_minus_one( EIO ); 851 847 break; 852 848 } 853 849 if (opcode == TFTP_OPCODE_ERROR) 854 set_errno_and_return_minus_one( tftpErrno (tp) );850 rtems_set_errno_and_return_minus_one( tftpErrno (tp) ); 855 851 } 856 852 … … 859 855 */ 860 856 if (++retryCount == IO_RETRY_LIMIT) 861 set_errno_and_return_minus_one( EIO );857 rtems_set_errno_and_return_minus_one( EIO ); 862 858 if (sendAck (tp) != 0) 863 set_errno_and_return_minus_one( EIO );859 rtems_set_errno_and_return_minus_one( EIO ); 864 860 } 865 861 } … … 978 974 if (e) { 979 975 tp->writing = 0; 980 set_errno_and_return_minus_one (e);976 rtems_set_errno_and_return_minus_one (e); 981 977 } 982 978 } -
cpukit/libnetworking/ChangeLog
r3cb43d3 rd4651e4 1 2002-02-04 Ralf Corsepius <corsepiu@faw.uni-ulm.de> 2 3 * lib/tftpDriver.c: Remove set_errno_and_return_minus_one, include 4 <rtems/seterr.h>. 5 6 1 7 2001-12-18 Eric Norum <eric.norum@usask.ca> 2 8 -
cpukit/libnetworking/lib/tftpDriver.c
r3cb43d3 rd4651e4 26 26 #include <rtems/libio.h> 27 27 #include <rtems/libio_.h> 28 #include <rtems/seterr.h> 28 29 #include <rtems/rtems_bsdnet.h> 29 30 #include <sys/types.h> … … 31 32 #include <netinet/in.h> 32 33 #include <arpa/inet.h> 33 34 #ifndef set_errno_and_return_minus_one35 #define set_errno_and_return_minus_one( _error ) \36 do { errno = (_error); return -1; } while(0)37 #endif38 34 39 35 #ifdef RTEMS_TFTP_DRIVER_DEBUG … … 229 225 230 226 if (sc != RTEMS_SUCCESSFUL) 231 set_errno_and_return_minus_one( ENOMEM );227 rtems_set_errno_and_return_minus_one( ENOMEM ); 232 228 233 229 return 0; … … 432 428 { 433 429 pathloc->node_access = NULL; 434 set_errno_and_return_minus_one( EIO );430 rtems_set_errno_and_return_minus_one( EIO ); 435 431 } 436 432 … … 509 505 */ 510 506 if (flags & RTEMS_LIBIO_PERMS_RDWR) 511 set_errno_and_return_minus_one( EISDIR );507 rtems_set_errno_and_return_minus_one( EISDIR ); 512 508 if (isRelative) { 513 509 cp = malloc (strlen(pathloc->node_access)+strlen(pathname)+1); 514 510 if (cp == NULL) 515 set_errno_and_return_minus_one( ENOMEM );511 rtems_set_errno_and_return_minus_one( ENOMEM ); 516 512 strcpy (cp, pathloc->node_access); 517 513 strcat (cp, pathname); … … 520 516 cp = strdup (pathname); 521 517 if (cp == NULL) 522 set_errno_and_return_minus_one( ENOMEM );518 rtems_set_errno_and_return_minus_one( ENOMEM ); 523 519 } 524 520 fixPath (cp); … … 534 530 flags &= RTEMS_LIBIO_PERMS_READ | RTEMS_LIBIO_PERMS_WRITE; 535 531 if ((flags != RTEMS_LIBIO_PERMS_READ) && (flags != RTEMS_LIBIO_PERMS_WRITE) ) 536 set_errno_and_return_minus_one( EINVAL );532 rtems_set_errno_and_return_minus_one( EINVAL ); 537 533 return 0; 538 534 } … … 848 844 tp->blocknum++; 849 845 if (sendAck (tp) != 0) 850 set_errno_and_return_minus_one( EIO );846 rtems_set_errno_and_return_minus_one( EIO ); 851 847 break; 852 848 } 853 849 if (opcode == TFTP_OPCODE_ERROR) 854 set_errno_and_return_minus_one( tftpErrno (tp) );850 rtems_set_errno_and_return_minus_one( tftpErrno (tp) ); 855 851 } 856 852 … … 859 855 */ 860 856 if (++retryCount == IO_RETRY_LIMIT) 861 set_errno_and_return_minus_one( EIO );857 rtems_set_errno_and_return_minus_one( EIO ); 862 858 if (sendAck (tp) != 0) 863 set_errno_and_return_minus_one( EIO );859 rtems_set_errno_and_return_minus_one( EIO ); 864 860 } 865 861 } … … 978 974 if (e) { 979 975 tp->writing = 0; 980 set_errno_and_return_minus_one (e);976 rtems_set_errno_and_return_minus_one (e); 981 977 } 982 978 }
Note: See TracChangeset
for help on using the changeset viewer.