From: Andre Noll Date: Mon, 14 Jun 2010 15:09:04 +0000 (+0200) Subject: Print a log message if the sender command fails. X-Git-Tag: v0.4.3~18 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=f7feafeef70ad8f4e8c6fff715a2287f3240e759;hp=7a1764a24f86bd33beff864b52605ae739a65ca5 Print a log message if the sender command fails. 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. --- diff --git a/vss.c b/vss.c index 898180c0..0eb235c7 100644 --- 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; - 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)