[torqueusers] qmgr truncates output in batch mode
jan.jn.nilsson at consultant.volvo.com
Fri Jun 12 02:16:03 MDT 2009
Garrick Staples wrote:
>On Thu, Jun 11, 2009 at 04:58:30PM +0200, Jan Nilsson alleged:
>>We have experienced some problems using "qmgr -c <cmd>" in scripts.
>>The output seemed truncated or the qmgr was crashing prematurely.
>>When analyzing it in depth - we found that it seems to be connected to
>>"qmgr" using the readline() utility.
>>My colleague found that adding a fflush(NULL) before exiting solved the
>Why at that exact location? There are several ways out of the code. Why not
>just stick it inside of clean_up_and_exit()?
This was a QnD fix to an acute problem - and we reproduced it in exactly
that way out of the code.
So I guess my colleague made a minimum fix... since we had (and still
have) more urgent problems with TORQUE/MAUI.
I think you're right though - clean_up_and_exit() seems like the right
Something like this?
----------------- diff -Naur cmds*/qmgr.c
--- cmds.old/qmgr.c 2009-06-11 16:04:47.000000000 +0200
+++ cmds/qmgr.c 2009-06-12 10:11:23.000000000 +0200
@@ -957,7 +957,7 @@
* clean_up_and_exit - disconnect from the servers and free memory used
- * by active object lists and then exits
+ * by active object lists, flush output and then exits
* exit_val - value to pass to exit
@@ -983,6 +983,7 @@
cur_svr = next_svr;
+ fflush(NULL); /* peter h IPSec+jan n NANCO 2009 * fix truncated output. */
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 524 bytes
Desc: not available
Url : http://www.supercluster.org/pipermail/torqueusers/attachments/20090612/7b86cf65/attachment.bin
More information about the torqueusers