Example #1
0
int
rpl_close (int fd)
{
#if WINDOWS_SOCKETS
  int retval = execute_all_close_hooks (close_nothrow, fd);
#else
  int retval = close_nothrow (fd);
#endif

#if REPLACE_FCHDIR
  if (retval >= 0)
    _gl_unregister_fd (fd);
#endif

  return retval;
}
Example #2
0
/* Override close() to call into other gnulib modules: */
int rpl_close(int fd)
{
#if defined(WINDOWS_SOCKETS) && WINDOWS_SOCKETS
  int retval = execute_all_close_hooks(close_nothrow, fd);
#else
  int retval = close_nothrow(fd);
#endif /* WINDOWS_SOCKETS */

#if defined(REPLACE_FCHDIR) && REPLACE_FCHDIR
  if (retval >= 0) {
    _gl_unregister_fd(fd);
  }
#endif /* REPLACE_FCHDIR */

  return retval;
}