]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Print a log message if the sender command fails.
authorAndre Noll <maan@systemlinux.org>
Mon, 14 Jun 2010 15:09:04 +0000 (17:09 +0200)
committerAndre Noll <maan@systemlinux.org>
Mon, 14 Jun 2010 15:09:04 +0000 (17:09 +0200)
Currently there is no infrastructure for passing down a value from vss,
which runs in parent context, to the child process. In particular,
we can not pass the return value of the sender subcommand handlers
to com_sender() to propagate it to the client.

However, we may easily write a log message that explains the cause
of the error, which is not optimal, but better than nothing.

Thanks to Gerrit Renker who pointed out this flaw.

vss.c

diff --git a/vss.c b/vss.c
index 898180c013a4845481bbfd48782fa9168f8e9048..0eb235c72e711391beee1f417ca997e8c5d65870 100644 (file)
--- a/vss.c
+++ b/vss.c
@@ -920,8 +920,12 @@ static void vss_post_select(struct sched *s, struct task *t)
                int num = mmd->sender_cmd_data.cmd_num,
                        sender_num = mmd->sender_cmd_data.sender_num;
 
                int num = mmd->sender_cmd_data.cmd_num,
                        sender_num = mmd->sender_cmd_data.sender_num;
 
-               if (senders[sender_num].client_cmds[num])
-                       senders[sender_num].client_cmds[num](&mmd->sender_cmd_data);
+               if (senders[sender_num].client_cmds[num]) {
+                       ret = senders[sender_num].client_cmds[num]
+                               (&mmd->sender_cmd_data);
+                       if (ret < 0)
+                               PARA_ERROR_LOG("%s\n", para_strerror(-ret));
+               }
                mmd->sender_cmd_data.cmd_num = -1;
        }
        if (vsst->afsss != AFS_SOCKET_CHECK_FOR_WRITE)
                mmd->sender_cmd_data.cmd_num = -1;
        }
        if (vsst->afsss != AFS_SOCKET_CHECK_FOR_WRITE)