[libvirt] [PATCH 06/10] util: error: Improve docs for virErrorMsg

Peter Krempa posted 10 patches 7 years, 2 months ago
[libvirt] [PATCH 06/10] util: error: Improve docs for virErrorMsg
Posted by Peter Krempa 7 years, 2 months ago
Clarify how @info is used and how the returned values look like.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/util/virerror.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/util/virerror.c b/src/util/virerror.c
index be23712a60..7444d671bb 100644
--- a/src/util/virerror.c
+++ b/src/util/virerror.c
@@ -906,12 +906,14 @@ void virRaiseErrorObject(const char *filename,
 /**
  * virErrorMsg:
  * @error: the virErrorNumber
- * @info: usually the first parameter string
+ * @info: additional info string
  *
- * Internal routine to get the message associated to an error raised
- * from the library
+ * Internal routine to get the message associated to @error raised
+ * from the library.
  *
- * Returns the constant string associated to @error
+ * Returns a *printf format string which describes @error. The returned string
+ * contains exactly one '%s' modifier if @info is non-NULL, or no modifiers at
+ * all if @info is NULL. If @error is invalid NULL is returned.
  */
 const char *
 virErrorMsg(virErrorNumber error, const char *info)
-- 
2.19.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 06/10] util: error: Improve docs for virErrorMsg
Posted by Erik Skultety 7 years, 2 months ago
On Wed, Dec 05, 2018 at 05:47:47PM +0100, Peter Krempa wrote:
> Clarify how @info is used and how the returned values look like.

s/how/what

...on a side note, there's no such thing as "how it looks *like*", only
"how it looks". The difference between "what it looks like" and "how it looks"
seems to be quite debatable, some people say the meaning is the same while some
say there's a slight difference.

Reviewed-by: Erik Skultety <eskultet@redhat.com>

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list