Fixing a problem on savefile (stdin was not saved well, and the file not
truncated)
--- 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);
}
}
--- 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);