filters/log/log.c
/* Shared code for a nicer log of return value */
Shared code for a nicer log of return value
Shared code for a nicer log of return value
static void
output_return (struct handle *h, const char *act, uint64_t id, int r, int *err)
{
  const char *s = "Other=>EINVAL";
  if (r == -1) {
    switch (*err) {
    case EROFS:
      s = "EROFS=>EPERM";
      break;
    case EPERM:
      s = "EPERM";
      break;
    case EIO:
      s = "EIO";
      break;
    case ENOMEM:
      s = "ENOMEM";
      break;
#ifdef EDQUOT
    case EDQUOT:
      s = "EDQUOT=>ENOSPC";
      break;
#endif
    case EFBIG:
      s = "EFBIG=>ENOSPC";
      break;
    case ENOSPC:
      s = "ENOSPC";
      break;
#ifdef ESHUTDOWN
    case ESHUTDOWN:
      s = "ESHUTDOWN";
      break;
#endif
    case EINVAL:
      s = "EINVAL";
      break;
    }
  }
  else {
    s = "Success";
  }
  output (h, act, id, "return=%d (%s)", r, s);
}
static void output_return ( struct handle * h , const char * act , uint64_t id , int r , int * err ) { const char * s = " " ; if ( r == -1 ) { switch ( * err ) { case EROFS : s = " " ; break ; case EPERM : s = " " ; break ; case EIO : s = " " ; break ; case ENOMEM : s = " " ; break ; #ifdef EDQUOT case EDQUOT : s = " " ; break ; #endif case EFBIG : s = " " ; break ; case ENOSPC : s = " " ; break ; #ifdef ESHUTDOWN case ESHUTDOWN : s = " " ; break ; #endif case EINVAL : s = " " ; break ; } } else { s = " " ; } output ( h , act , id , " " , r , s ) ; }
Shared code for a nicer log of return value
Shared code for a nicer log of return value
/* Only decode what connections.c:nbd_errno() recognizes */