+#if DEBUG_FDS
+ struct GNUNET_SCHEDULER_Task *t;
+
+ for (t = pending_head; NULL != t; t = t->next)
+ {
+ if (-1 != t->read_fd)
+ {
+ int flags = fcntl (t->read_fd, F_GETFD);
+ if ((flags == -1) && (errno == EBADF))
+ {
+ LOG (GNUNET_ERROR_TYPE_ERROR,
+ "Got invalid file descriptor %d!\n",
+ t->read_fd);
+#if EXECINFO
+ unsigned int i;
+
+ for (i = 0; i < t->num_backtrace_strings; i++)
+ LOG (GNUNET_ERROR_TYPE_ERROR,
+ "Trace: %s\n",
+ t->backtrace_strings[i]);
+#endif
+ }
+ }
+ if (-1 != t->write_fd)
+ {
+ int flags = fcntl (t->write_fd, F_GETFD);
+ if ((flags == -1) && (errno == EBADF))
+ {
+ LOG (GNUNET_ERROR_TYPE_ERROR,
+ "Got invalid file descriptor %d!\n",
+ t->write_fd);
+#if EXECINFO
+ unsigned int i;
+
+ for (i = 0; i < t->num_backtrace_strings; i++)
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Trace: %s\n",
+ t->backtrace_strings[i]);
+#endif
+ }
+ }
+ }
+#endif
+ GNUNET_assert (0);