tsocket: ENOMEM can be retried on illumos/Solaris.
authorIra Cooper <ira@samba.org>
Wed, 13 Mar 2013 13:36:11 +0000 (13:36 +0000)
committerJeremy Allison <jra@samba.org>
Wed, 13 Mar 2013 22:50:04 +0000 (23:50 +0100)
The writev system call can return -1 and errno ENOMEM, as a
retriable condition.

Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Mar 13 23:50:05 CET 2013 on sn-devel-104

lib/tsocket/tsocket_bsd.c

index 4b54d319a0d2fd6aab4d4e3c552656d18e096f92..89e5f4cee89691db4c62a8edf075e41d0e321fcf 100644 (file)
@@ -60,6 +60,12 @@ static int tsocket_bsd_error_from_errno(int ret,
                return sys_errno;
        }
 
+       /* ENOMEM is retryable on Solaris/illumos, and possibly other systems. */
+       if (sys_errno == ENOMEM) {
+               *retry = true;
+               return sys_errno;
+       }
+
 #ifdef EWOULDBLOCK
        if (sys_errno == EWOULDBLOCK) {
                *retry = true;