rsh in gtk program



Hi List,
In my gtk1.2 program I need to run command on Solaris machine and wait
until
it finishes and then run rcp to copy files from Solaris machine. I am
trying following code. rsh does its job but my program stops. I tried
this
code with only rcp and it works fine. What exactly I need to do? 
Thanks in advance.
Rajesh
---------------------------
void
on_Update_In_Database_Maint_clicked    (GtkButton       *button,
                                                                                                      
            gpointer         user_data)
{
  pid_t wait(int *status);
  pid_t pid1;
  pid_t pid2;
  if ((pid1 = fork()) == 0) {
         execlp(?rsh?, ?rsh?, Hostname, ?/usr/prog/myprog?, NULL);
  }
  else {
         while (wait(NULL) != pid1) {
                 sleep(3);
         }
  }
  if ((pid2 = fork()) == 0) {
         execlp(?rcp?, ?rcp?, g_strdup_printf(?%s:%schkpnt.out?, 
Hostname,
 InstallDir),  InstallDir, NULL);
  }
  else {
         while (wait(NULL) != pid2) {
                 sleep(3);
         }
  }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]