WiP
[oweals/gnunet.git] / src / util / network.c
index 9e85a3be9dc6817b9b80b26b787eacde394be9a1..d23f1a23d7726da871c06360a69aa485f23272d7 100644 (file)
@@ -451,6 +451,7 @@ GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle
     return GNUNET_NO;
 }
 
+
 /**
  * Read data from a connected socket (always non-blocking).
  * @param desc socket
@@ -774,12 +775,20 @@ GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to,
 #endif
 }
 
+
+/**
+ * Return file descriptor for this network handle
+ *
+ * @param desc wrapper to process
+ * @return POSIX file descriptor
+ */
 int
 GNUNET_NETWORK_get_fd (struct GNUNET_NETWORK_Handle *desc)
 {
   return desc->fd;
 }
 
+
 /**
  * Copy a native fd set
  *
@@ -805,6 +814,7 @@ GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to,
 void GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to,
                                      int nfd)
 {
+  GNUNET_assert(nfd >= 0);
   FD_SET (nfd, &to->sds);
   to->nsds = GNUNET_MAX (nfd + 1, to->nsds);
 }