tsocket: Fixed the documentation of tsocket_address_bsd_sockaddr.
authorAndreas Schneider <asn@samba.org>
Mon, 3 May 2010 09:25:26 +0000 (11:25 +0200)
committerAndreas Schneider <asn@samba.org>
Mon, 3 May 2010 13:55:34 +0000 (15:55 +0200)
lib/tsocket/tsocket.h

index d4f9e872d3fed5988e00113803be24a0d4b9d624..7d6a174748c76b25e5b6282bfe30c87094f676e5 100644 (file)
@@ -902,16 +902,23 @@ ssize_t tsocket_address_bsd_sockaddr(const struct tsocket_address *addr,
  * for anything else. The file descriptor will be closed when the stream gets
  * freed. If you still want to use the fd you have have to create a duplicate.
  *
- * @param[in]  mem_ctx      The talloc memory context to use.
+ * @param[in]  mem_ctx  The talloc memory context to use.
  *
- * @param[in]  fd           The non blocking fd to use!
+ * @param[in]  fd       The non blocking fd to use!
  *
- * @param[in]  stream       The filed tstream_context you allocated before.
+ * @param[out] stream   A pointer to store an allocated tstream_context.
  *
- * @return              0 on success, -1 on error with errno set.
+ * @return              0 on success, -1 on error.
  *
- * @warning You should read the tsocket_bsd.c code and unterstand it in order
- * use this function.
+ * Example:
+ * @code
+ *   fd2 = dup(fd);
+ *   rc = tstream_bsd_existing_socket(mem_ctx, fd2, &tstream);
+ *   if (rc < 0) {
+ *     stream_terminate_connection(conn, "named_pipe_accept: out of memory");
+ *     return;
+ *   }
+ * @endcode
  */
 int tstream_bsd_existing_socket(TALLOC_CTX *mem_ctx,
                                int fd,