Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use xbt_XXX_is_empty() instead of testing xbt_XXX_length() against 0.
[simgrid.git] / src / gras / Transport / transport_plugin_tcp.c
index adf691ccd16eb9d54921f9423a4b20219a67fa40..b74bf905e9553c7d1935386b49f6f9436d897307 100644 (file)
@@ -767,12 +767,12 @@ void gras_trp_buf_socket_close(gras_socket_t sock)
 
 #ifdef HAVE_READV
   if (data->in_buf_v) {
-    if (xbt_dynar_length(data->in_buf_v))
+    if (!xbt_dynar_is_empty(data->in_buf_v))
       XBT_WARN("Socket closed, but some bytes were unread");
     xbt_dynar_free(&data->in_buf_v);
   }
   if (data->out_buf_v) {
-    if (xbt_dynar_length(data->out_buf_v)) {
+    if (!xbt_dynar_is_empty(data->out_buf_v)) {
       XBT_DEBUG("Flush the socket before closing");
       gras_trp_bufiov_flush(sock);
     }