CodingStyle: Mention our common return value conventions.
authorBen Pfaff <blp@nicira.com>
Fri, 1 Mar 2013 19:02:31 +0000 (11:02 -0800)
committerBen Pfaff <blp@nicira.com>
Mon, 4 Mar 2013 16:14:07 +0000 (08:14 -0800)
CC: Andy Zhou <azhou@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
CodingStyle

index ee7a0e6..22f0f45 100644 (file)
@@ -249,6 +249,18 @@ details.  (Some compilers also assume that the "if" branch is the more
 common case, so this can be a real form of optimization as well.)
 
 
+RETURN VALUES
+
+  For functions that return a success or failure indication, prefer
+one of the following return value conventions:
+
+    * An "int" where 0 indicates success and a positive errno value
+      indicates a reason for failure.
+
+    * A "bool" where true indicates success and false indicates
+      failure.
+
+
 MACROS
 
   Don't define an object-like macro if an enum can be used instead.