server/connections.c
/* Convert a system errno to an NBD_E* error code. */
Convert a system errno to an NBD_E* error code.
Convert a system errno to an NBD_E * error code .
static int
nbd_errno (int error)
{
  switch (error) {
  case 0:
    return NBD_SUCCESS;
  case EROFS:
  case EPERM:
    return NBD_EPERM;
  case EIO:
    return NBD_EIO;
  case ENOMEM:
    return NBD_ENOMEM;
#ifdef EDQUOT
  case EDQUOT:
#endif
  case EFBIG:
  case ENOSPC:
    return NBD_ENOSPC;
#ifdef ESHUTDOWN
  case ESHUTDOWN:
    return NBD_ESHUTDOWN;
#endif
  case EINVAL:
  default:
    return NBD_EINVAL;
  }
}
static int nbd_errno ( int error ) { switch ( error ) { case 0 : return NBD_SUCCESS ; case EROFS : case EPERM : return NBD_EPERM ; case EIO : return NBD_EIO ; case ENOMEM : return NBD_ENOMEM ; #ifdef EDQUOT case EDQUOT : #endif case EFBIG : case ENOSPC : return NBD_ENOSPC ; #ifdef ESHUTDOWN case ESHUTDOWN : return NBD_ESHUTDOWN ; #endif case EINVAL : default : return NBD_EINVAL ; } }
Convert a system errno to an NBD_E* error code.
Convert a system errno to an NBD_E * error code .