~camicrisystems/cube-server/v4

« back to all changes in this revision

Viewing changes to src/process-manager.vala

  • Committer: camicrisystems at gmail
  • Date: 2017-11-15 14:40:04 UTC
  • Revision ID: camicrisystems@gmail.com-20171115144004-xbpd0jx9ekbyfmiv
Initial Cube v4 Update

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
        public void run(string[] arguments , string working_directory = Environment.get_current_dir())
101
101
        {               
102
102
                loop = new MainLoop ();
 
103
                int standard_input;
 
104
                int standard_output;
 
105
                int standard_error;
 
106
                
103
107
                try {
104
108
 
105
 
                        int standard_input;
106
 
                        int standard_output;
107
 
                        int standard_error;
108
 
 
109
109
                        Process.spawn_async_with_pipes (working_directory,
110
110
                                arguments,
111
111
                                /*Windows Fix*/ /*Environ.get (),*/
139
139
 
140
140
                        started();
141
141
                        loop.run ();
 
142
                        Posix.close(standard_input);
 
143
                        Posix.close(standard_output);
 
144
                        Posix.close(standard_error);
 
145
                        Process.close_pid(_child_pid);
142
146
                } catch (SpawnError e) {
143
147
                        stdout.printf("[ProcMgr] Error : %s\n",e.message);
144
148
                        //error ( e.message );
145
149
                        output_changed("Error : "+e.message);
 
150
 
 
151
                        Posix.close(standard_input);
 
152
                        Posix.close(standard_output);
 
153
                        Posix.close(standard_error);
 
154
                        Process.close_pid(_child_pid);
 
155
                        
146
156
                        loop.quit ();
147
157
                }
148
158
        }