[Tarantool-patches] [PATCH 05/12] popen: remove retval from popen_stat()

Alexander Turenko alexander.turenko at tarantool.org
Tue Apr 14 14:38:14 MSK 2020


The change 'popen: require popen handle to be non-NULL' makes
popen_stat() function always successful. There is no reason to return a
success / failure result.

See the previous similar patch: 'popen: remove retval from
popen_state()'.

Part of #4031
---
 src/lib/core/popen.c | 3 +--
 src/lib/core/popen.h | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/lib/core/popen.c b/src/lib/core/popen.c
index c74ac17c7..3ba1e2a48 100644
--- a/src/lib/core/popen.c
+++ b/src/lib/core/popen.c
@@ -239,7 +239,7 @@ popen_may_pidop(struct popen_handle *handle)
 /**
  * Fill popen object statistics.
  */
-int
+void
 popen_stat(struct popen_handle *handle, struct popen_stat *st)
 {
 	assert(handle != NULL);
@@ -252,7 +252,6 @@ popen_stat(struct popen_handle *handle, struct popen_stat *st)
 
 	for (size_t i = 0; i < lengthof(handle->ios); i++)
 		st->fds[i] = handle->ios[i].fd;
-	return 0;
 }
 
 /**
diff --git a/src/lib/core/popen.h b/src/lib/core/popen.h
index 570376d33..4cdd95175 100644
--- a/src/lib/core/popen.h
+++ b/src/lib/core/popen.h
@@ -159,7 +159,7 @@ struct popen_stat {
 	int			fds[POPEN_FLAG_FD_STDEND_BIT];
 };
 
-extern int
+extern void
 popen_stat(struct popen_handle *handle, struct popen_stat *st);
 
 extern const char *
-- 
2.25.0



More information about the Tarantool-patches mailing list