[PATCH 2/4] rpc: Make some functions void

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There are few functions that currently return an integer but in
fact they always return the same integer (zero). Make them void.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/rpc/virnetlibsshsession.c | 4 +---
 src/rpc/virnetlibsshsession.h | 4 ++--
 src/rpc/virnetsocket.c        | 6 ++----
 src/rpc/virnetsshsession.c    | 4 +---
 src/rpc/virnetsshsession.h    | 4 ++--
 5 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/src/rpc/virnetlibsshsession.c b/src/rpc/virnetlibsshsession.c
index 9c20a80b88..0a566eaa54 100644
--- a/src/rpc/virnetlibsshsession.c
+++ b/src/rpc/virnetlibsshsession.c
@@ -1082,11 +1082,10 @@ virNetLibsshSessionAuthAddKeyboardAuth(virNetLibsshSessionPtr sess,
 
 }
 
-int
+void
 virNetLibsshSessionSetChannelCommand(virNetLibsshSessionPtr sess,
                                       const char *command)
 {
-    int ret = 0;
     virObjectLock(sess);
 
     VIR_FREE(sess->channelCommand);
@@ -1094,7 +1093,6 @@ virNetLibsshSessionSetChannelCommand(virNetLibsshSessionPtr sess,
     sess->channelCommand = g_strdup(command);
 
     virObjectUnlock(sess);
-    return ret;
 }
 
 int
diff --git a/src/rpc/virnetlibsshsession.h b/src/rpc/virnetlibsshsession.h
index 231c2591b2..e982bcd2ef 100644
--- a/src/rpc/virnetlibsshsession.h
+++ b/src/rpc/virnetlibsshsession.h
@@ -35,8 +35,8 @@ typedef enum {
     VIR_NET_LIBSSH_HOSTKEY_VERIFY_IGNORE
 } virNetLibsshHostkeyVerify;
 
-int virNetLibsshSessionSetChannelCommand(virNetLibsshSessionPtr sess,
-                                         const char *command);
+void virNetLibsshSessionSetChannelCommand(virNetLibsshSessionPtr sess,
+                                          const char *command);
 
 int virNetLibsshSessionAuthSetCallback(virNetLibsshSessionPtr sess,
                                        virConnectAuthPtr auth);
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index 6c790cb577..3ea863f625 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -969,8 +969,7 @@ virNetSocketNewConnectLibSSH2(const char *host,
                                                VIR_NET_SSH_HOSTKEY_FILE_CREATE) != 0)
         goto error;
 
-    if (virNetSSHSessionSetChannelCommand(sess, command) != 0)
-        goto error;
+    virNetSSHSessionSetChannelCommand(sess, command);
 
     if (!(authMethodList = virStringSplit(authMethods, ",", 0)))
         goto error;
@@ -1101,8 +1100,7 @@ virNetSocketNewConnectLibssh(const char *host,
                                                   verify) != 0)
         goto error;
 
-    if (virNetLibsshSessionSetChannelCommand(sess, command) != 0)
-        goto error;
+    virNetLibsshSessionSetChannelCommand(sess, command);
 
     if (!(authMethodList = virStringSplit(authMethods, ",", 0)))
         goto error;
diff --git a/src/rpc/virnetsshsession.c b/src/rpc/virnetsshsession.c
index fabdc3ef22..b4dea15452 100644
--- a/src/rpc/virnetsshsession.c
+++ b/src/rpc/virnetsshsession.c
@@ -1132,11 +1132,10 @@ virNetSSHSessionAuthAddKeyboardAuth(virNetSSHSessionPtr sess,
 
 }
 
-int
+void
 virNetSSHSessionSetChannelCommand(virNetSSHSessionPtr sess,
                                   const char *command)
 {
-    int ret = 0;
     virObjectLock(sess);
 
     VIR_FREE(sess->channelCommand);
@@ -1144,7 +1143,6 @@ virNetSSHSessionSetChannelCommand(virNetSSHSessionPtr sess,
     sess->channelCommand = g_strdup(command);
 
     virObjectUnlock(sess);
-    return ret;
 }
 
 int
diff --git a/src/rpc/virnetsshsession.h b/src/rpc/virnetsshsession.h
index 0101489302..4d639da453 100644
--- a/src/rpc/virnetsshsession.h
+++ b/src/rpc/virnetsshsession.h
@@ -40,8 +40,8 @@ typedef enum {
     VIR_NET_SSH_HOSTKEY_FILE_CREATE   = 1 << 1,
 } virNetSSHHostKeyFileFlags;
 
-int virNetSSHSessionSetChannelCommand(virNetSSHSessionPtr sess,
-                                      const char *command);
+void virNetSSHSessionSetChannelCommand(virNetSSHSessionPtr sess,
+                                       const char *command);
 
 void virNetSSHSessionAuthReset(virNetSSHSessionPtr sess);
 
-- 
2.26.2





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux