git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] strbuf: Correct documentation for strbuf_read_once

From
Stefan Beller <sbeller@google.com>
Date
Nov 5, 2015, 18:17 UTC
Message-ID
<1446747439-30349-3-git-send-email-sbeller@google.com>
In-Reply-To
<1446747439-30349-1-git-send-email-sbeller@google.com>

No need to document the O_NONBLOCK. We will read just once and return. In case the read blocks, this works too.

Signed-off-by: Stefan Beller <sbeller@google.com>
---
 strbuf.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/strbuf.h b/strbuf.h
index ea69665..7a08da4 100644
--- a/strbuf.h
+++ b/strbuf.h
@@ -367,8 +367,7 @@ extern size_t strbuf_fread(struct strbuf *, size_t, FILE *);
 extern ssize_t strbuf_read(struct strbuf *, int fd, size_t hint);
 
 /**
- * Read from a file descriptor that is marked as O_NONBLOCK without
- * blocking.  Returns the number of new bytes appended to the sb.
+ * Returns the number of new bytes appended to the sb.
  * Negative return value signals there was an error returned from
  * underlying read(2), in which case the caller should check errno.
  * e.g. errno == EAGAIN when the read may have blocked.
-- 
2.6.1.247.ge8f2a41.dirty
Previous: Johannes Sixt
Message 12 of 12 in “Remove non-blocking fds from run-command.”
  1. 0/2 Remove non-blocking fds from run-command.Stefan Beller, Nov 5, 2015
  2. 1/2 run-command: Remove set_nonblockingStefan Beller, Nov 5, 2015
  3. Junio C HamanoNov 5, 2015
  4. Stefan BellerNov 5, 2015
  5. Junio C HamanoNov 5, 2015
  6. Johannes SixtNov 5, 2015
  7. Junio C HamanoNov 5, 2015
  8. Stefan BellerNov 5, 2015
  9. Johannes SixtNov 6, 2015
  10. Stefan BellerNov 6, 2015
  11. Johannes SixtNov 6, 2015
  12. 2/2 strbuf: Correct documentation for strbuf_read_onceStefan Beller, Nov 5, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.