# HG changeset patch # User viric # Date 1297886831 -3600 # Node ID 13360d8af3131e038cd8e413291fd1c3408cb23d # Parent 330324fc7c203a4575c49f92e12228d7f6526da3 Fixing a problem on savefile (stdin was not saved well, and the file not truncated) diff -r 330324fc7c20 -r 13360d8af313 app_control.c --- a/app_control.c Wed Feb 16 20:57:32 2011 +0100 +++ b/app_control.c Wed Feb 16 21:07:11 2011 +0100 @@ -159,6 +159,8 @@ { hex_dump("from local to app", buffer, size); write(app_stdin, buffer, size); + if (savefile != -1) + write(savefile, buffer, size); } } diff -r 330324fc7c20 -r 13360d8af313 server.c --- a/server.c Wed Feb 16 20:57:32 2011 +0100 +++ b/server.c Wed Feb 16 21:07:11 2011 +0100 @@ -149,7 +149,8 @@ if (command_line.s_param.savefile) { - savefile = open(command_line.s_param.savefile, O_CREAT | O_RDWR, 0666); + savefile = open(command_line.s_param.savefile, + O_CREAT | O_TRUNC | O_RDWR, 0666); } child = fork_app(command_line.s_param.command);