Commit 81a52093a1919d9ce83f7c45cc556a40b95c923d

Authored by Stéphane Raimbault
1 parent 9d5344cf

Add comment about return code of flush functions

Showing 1 changed file with 2 additions and 1 deletions
src/modbus.c
@@ -121,7 +121,8 @@ int modbus_flush(modbus_t *ctx) @@ -121,7 +121,8 @@ int modbus_flush(modbus_t *ctx)
121 { 121 {
122 int rc = ctx->backend->flush(ctx); 122 int rc = ctx->backend->flush(ctx);
123 if (rc != -1 && ctx->debug) { 123 if (rc != -1 && ctx->debug) {
124 - printf("%d bytes flushed\n", rc); 124 + /* Not all backends are able to return the number of bytes flushed */
  125 + printf("Bytes flushed (%d)\n", rc);
125 } 126 }
126 return rc; 127 return rc;
127 } 128 }