[PATCH 4/4] ntdb: Fix control reaches end of non-void function.

Andreas Schneider asn at samba.org
Thu Nov 20 02:26:37 MST 2014


Signed-off-by: Andreas Schneider <asn at samba.org>
---
 lib/ntdb/test/run-01-new_database.c  | 6 ++++++
 lib/ntdb/test/run-02-expand.c        | 6 ++++++
 lib/ntdb/test/run-05-readonly-open.c | 6 ++++++
 lib/ntdb/test/run-10-simple-store.c  | 6 ++++++
 lib/ntdb/test/run-11-simple-fetch.c  | 6 ++++++
 lib/ntdb/test/run-12-check.c         | 6 ++++++
 lib/ntdb/test/run-35-convert.c       | 6 ++++++
 lib/ntdb/test/run-capabilities.c     | 6 ++++++
 8 files changed, 48 insertions(+)

diff --git a/lib/ntdb/test/run-01-new_database.c b/lib/ntdb/test/run-01-new_database.c
index fe142bd..ab69477 100644
--- a/lib/ntdb/test/run-01-new_database.c
+++ b/lib/ntdb/test/run-01-new_database.c
@@ -31,4 +31,10 @@ int main(int argc, char *argv[])
 			break;
 	}
 	failtest_exit(exit_status());
+
+	/*
+	 * We will never reach this but the compiler complains if we do not
+	 * return in this function.
+	 */
+	return EFAULT;
 }
diff --git a/lib/ntdb/test/run-02-expand.c b/lib/ntdb/test/run-02-expand.c
index 635bf89..e808989 100644
--- a/lib/ntdb/test/run-02-expand.c
+++ b/lib/ntdb/test/run-02-expand.c
@@ -59,4 +59,10 @@ int main(int argc, char *argv[])
 
 	ok1(tap_log_messages == 0);
 	failtest_exit(exit_status());
+
+	/*
+	 * We will never reach this but the compiler complains if we do not
+	 * return in this function.
+	 */
+	return EFAULT;
 }
diff --git a/lib/ntdb/test/run-05-readonly-open.c b/lib/ntdb/test/run-05-readonly-open.c
index e0de0d9..87caf95 100644
--- a/lib/ntdb/test/run-05-readonly-open.c
+++ b/lib/ntdb/test/run-05-readonly-open.c
@@ -70,4 +70,10 @@ fail:
 	failtest_suppress = true;
 	ntdb_close(ntdb);
 	failtest_exit(exit_status());
+
+	/*
+	 * We will never reach this but the compiler complains if we do not
+	 * return in this function.
+	 */
+	return EFAULT;
 }
diff --git a/lib/ntdb/test/run-10-simple-store.c b/lib/ntdb/test/run-10-simple-store.c
index 3e5959a..0add1f1 100644
--- a/lib/ntdb/test/run-10-simple-store.c
+++ b/lib/ntdb/test/run-10-simple-store.c
@@ -56,4 +56,10 @@ fail:
 	failtest_suppress = true;
 	ntdb_close(ntdb);
 	failtest_exit(exit_status());
+
+	/*
+	 * We will never reach this but the compiler complains if we do not
+	 * return in this function.
+	 */
+	return EFAULT;
 }
diff --git a/lib/ntdb/test/run-11-simple-fetch.c b/lib/ntdb/test/run-11-simple-fetch.c
index 9565ade..779a5ea 100644
--- a/lib/ntdb/test/run-11-simple-fetch.c
+++ b/lib/ntdb/test/run-11-simple-fetch.c
@@ -56,4 +56,10 @@ fail:
 	failtest_suppress = true;
 	ntdb_close(ntdb);
 	failtest_exit(exit_status());
+
+	/*
+	 * We will never reach this but the compiler complains if we do not
+	 * return in this function.
+	 */
+	return EFAULT;
 }
diff --git a/lib/ntdb/test/run-12-check.c b/lib/ntdb/test/run-12-check.c
index 8abc86d..7211761 100644
--- a/lib/ntdb/test/run-12-check.c
+++ b/lib/ntdb/test/run-12-check.c
@@ -43,4 +43,10 @@ fail:
 	failtest_suppress = true;
 	ntdb_close(ntdb);
 	failtest_exit(exit_status());
+
+	/*
+	 * We will never reach this but the compiler complains if we do not
+	 * return in this function.
+	 */
+	return EFAULT;
 }
diff --git a/lib/ntdb/test/run-35-convert.c b/lib/ntdb/test/run-35-convert.c
index b3ee737..873d4e7 100644
--- a/lib/ntdb/test/run-35-convert.c
+++ b/lib/ntdb/test/run-35-convert.c
@@ -55,4 +55,10 @@ int main(int argc, char *argv[])
 		ntdb_close(ntdb);
 	}
 	failtest_exit(exit_status());
+
+	/*
+	 * We will never reach this but the compiler complains if we do not
+	 * return in this function.
+	 */
+	return EFAULT;
 }
diff --git a/lib/ntdb/test/run-capabilities.c b/lib/ntdb/test/run-capabilities.c
index dac9302..f968393 100644
--- a/lib/ntdb/test/run-capabilities.c
+++ b/lib/ntdb/test/run-capabilities.c
@@ -274,4 +274,10 @@ int main(int argc, char *argv[])
 
 out:
 	failtest_exit(exit_status());
+
+	/*
+	 * We will never reach this but the compiler complains if we do not
+	 * return in this function.
+	 */
+	return EFAULT;
 }
-- 
2.1.2




More information about the samba-technical mailing list