I want to report a bug in the program tryto from socklog package. When exactly the last run of the c

"David Leška" <[email protected]>
Newsgroups gmane.comp.misc.pape.general
Message-ID <[email protected]>
I want to report a bug in the program tryto from socklog package. When
exactly the last run of the child program succeds, tryto reports that
child was not succeeded.
For example if somebody run command:
tryto -n 1 /bin/true
tryto reports the message:
tryto: fatal: child crashed, giving up.
It is nonsense, because /bin/true must always succeed.
When somebody use -n 2 switch and the first run of the child is
unsuccesfull but second run of the child is succesfull, the message
appears also. The same for the -n 3, -n 4, etc. I often use -n 1 switch
because I want a program to be run no more than once. I include a simple
patch correcting the problem. I noticed that author uses "rc" variable
to store both child exit code and  return code of tryto but it is not
good in the case child returns some of the tryto reserved values (111
and 100). I think using two variables "rc" and "child_rc" may improve
reliability of the program slightly.
tryto.c.patch (text/plain, 463 B)
--- tryto.c.000	2006-02-26 14:31:31.000000000 +0100
+++ tryto.c	2006-07-14 19:50:15.000000000 +0200
@@ -267,7 +267,7 @@
     if (processor) strerr_die2x(0, FATAL, "child timed out, giving up.");
     strerr_die2x(100, FATAL, "child timed out, giving up.");
   }
-  if (try >= trymax) {
+  if ((rc != 0) && (rc != 111)) {
     if (processor) strerr_die2x(0, FATAL, "child crashed, giving up.");
     strerr_die2x(rc >> 8, FATAL, "child crashed, giving up.");
   }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.