+command "commit": Write any pending changes and remount the volume.
authorshort <>
Fri, 4 Jul 2003 04:12:50 +0000 (04:12 +0000)
committershort <>
Fri, 4 Jul 2003 04:12:50 +0000 (04:12 +0000)
+disable stdout and stderr output buffering

src/client/cmdline/main.c

index b63e5dc..8c09a73 100644 (file)
@@ -42,6 +42,7 @@
 #include "cmd_mv.h"
 #include "cmd_mkdir.h"
 #include "cmd_rmdir.h"
+#include "cmd_commit.h"
 #include "cmd_quit.h"
 #include "cmd_help.h"
 
@@ -68,19 +69,20 @@ static const struct poptOption popt_table[]={
 
 const struct cmdline_command cmdline_command_table[]={
                /* First entry is the default if no command name was specified. */
-               { "shell",N_("Interactive commands shell.")                        ,cmd_shell_table,cmd_shell,0,0 },
-               { "cd"   ,N_("Print or change current guest-os directory[1].")     ,cmd_cd_table   ,cmd_cd   ,0,1 },
-               { "lcd"  ,N_("Print or change current host-os  directory[1].")     ,cmd_lcd_table  ,cmd_lcd  ,0,1 },
-               { "ls"   ,N_("Directory[1] listing.")                              ,cmd_ls_table   ,cmd_ls   ,0,1 },
-               { "get"  ,N_("Copy guest-os file[1] to host-os (opt. file[2]).")   ,cmd_get_table  ,cmd_get  ,1,2 },
-               { "put"  ,N_("Copy host-os file[1] to guest-os (opt. file[2]).")   ,cmd_put_table  ,cmd_put  ,1,2 },
-               { "info" ,N_("Query information about guest-os item[1].")          ,cmd_info_table ,cmd_info ,1,1 },
-               { "rm"   ,N_("Remove guest-os file[1].")                           ,cmd_rm_table   ,cmd_rm   ,1,1 },
-               { "mv"   ,N_("Move (rename) guest-os item[1] to guest-os item[2]."),cmd_mv_table   ,cmd_mv   ,2,2 },
-               { "mkdir",N_("Create guest-os directory[1].")                      ,cmd_mkdir_table,cmd_mkdir,1,1 },
-               { "rmdir",N_("Remove guest-os directory[1].")                      ,cmd_rmdir_table,cmd_rmdir,1,1 },
-               { "quit" ,N_("Quit this program.")                                 ,cmd_quit_table ,cmd_quit ,0,0 },
-               { "help" ,N_("Show this list of commands.")                        ,cmd_help_table ,cmd_help ,0,0 },
+               { "shell" ,N_("Interactive commands shell.")                        ,cmd_shell_table ,cmd_shell ,0,0 },
+               { "cd"    ,N_("Print or change current guest-os directory[1].")     ,cmd_cd_table    ,cmd_cd    ,0,1 },
+               { "lcd"   ,N_("Print or change current host-os  directory[1].")     ,cmd_lcd_table   ,cmd_lcd   ,0,1 },
+               { "ls"    ,N_("Directory[1] listing.")                              ,cmd_ls_table    ,cmd_ls    ,0,1 },
+               { "get"   ,N_("Copy guest-os file[1] to host-os (opt. file[2]).")   ,cmd_get_table   ,cmd_get   ,1,2 },
+               { "put"   ,N_("Copy host-os file[1] to guest-os (opt. file[2]).")   ,cmd_put_table   ,cmd_put   ,1,2 },
+               { "info"  ,N_("Query information about guest-os item[1].")          ,cmd_info_table  ,cmd_info  ,1,1 },
+               { "rm"    ,N_("Remove guest-os file[1].")                           ,cmd_rm_table    ,cmd_rm    ,1,1 },
+               { "mv"    ,N_("Move (rename) guest-os item[1] to guest-os item[2]."),cmd_mv_table    ,cmd_mv    ,2,2 },
+               { "mkdir" ,N_("Create guest-os directory[1].")                      ,cmd_mkdir_table ,cmd_mkdir ,1,1 },
+               { "rmdir" ,N_("Remove guest-os directory[1].")                      ,cmd_rmdir_table ,cmd_rmdir ,1,1 },
+               { "commit",N_("Write any pending changes and remount the volume.")  ,cmd_commit_table,cmd_commit,0,0 },
+               { "quit"  ,N_("Quit this program.")                                 ,cmd_quit_table  ,cmd_quit  ,0,0 },
+               { "help"  ,N_("Show this list of commands.")                        ,cmd_help_table  ,cmd_help  ,0,0 },
                { NULL },       /* G_N_ELEMENTS() not usable as sizeof() is not visible for 'extern' */
                };
 
@@ -223,6 +225,10 @@ struct captive_options options;
         * to restart failed children due to communication-failure alarms.
         */
 
+       /* Prevent output block buffering if redirecting stdout to file. */
+       setvbuf(stdout,(char *)NULL,_IONBF,0);
+       setvbuf(stderr,(char *)NULL,_IONBF,0);
+
        /* Initialize the i18n stuff */
        setlocale(LC_ALL,"");
        bindtextdomain(PACKAGE,LOCALEDIR);