Changeset 7917 for trunk/Ohana/src/opihi/pcontrol/rconnect.c
- Timestamp:
- Jul 16, 2006, 10:58:49 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/pcontrol/rconnect.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pcontrol/rconnect.c
r4762 r7917 34 34 pid = fork (); 35 35 if (!pid) { /* must be child process */ 36 if (VerboseMode()) fprintf (stderr, "starting remote connection to %s...", hostname);36 if (VerboseMode()) gprint (GP_ERR, "starting remote connection to %s...", hostname); 37 37 38 38 /* close the other ends of the pipes */ … … 52 52 53 53 status = execvp (argv[0], argv); 54 fprintf (stderr, "error starting remote shell process\n");54 gprint (GP_ERR, "error starting remote shell process\n"); 55 55 exit (1); 56 56 } … … 85 85 if (status == 0) goto connect_error; 86 86 if (status == -1) goto connect_error; 87 if (VerboseMode()) fprintf (stderr, "%d cycles to connect\n", i);87 if (VerboseMode()) gprint (GP_ERR, "%d cycles to connect\n", i); 88 88 FreeIOBuffer (&buffer); 89 89 90 if (VerboseMode()) fprintf (stderr, "Connected\n");90 if (VerboseMode()) gprint (GP_ERR, "Connected\n"); 91 91 92 92 stdio[0] = stdin_fd[1]; … … 101 101 102 102 connect_error: 103 if (VerboseMode()) fprintf (stderr, "error while connecting\n");103 if (VerboseMode()) gprint (GP_ERR, "error while connecting\n"); 104 104 105 105 /* avoid blocking on waitpid, test every 100 usec, up to 50 msec */ … … 116 116 117 117 if ((result == -1) && (errno != ECHILD)) { 118 fprintf (stderr, "unexpected error from waitpid (%d): programming error\n", errno);118 gprint (GP_ERR, "unexpected error from waitpid (%d): programming error\n", errno); 119 119 exit (1); 120 120 } 121 121 if (result == 0) { 122 if (VerboseMode()) fprintf (stderr, "child did not exit??");122 if (VerboseMode()) gprint (GP_ERR, "child did not exit??"); 123 123 } 124 124 if (result > 0) { 125 125 if (result != pid) { 126 fprintf (stderr, "waitpid error: mis-matched PID (%d vs %d). programming error\n", result, pid);126 gprint (GP_ERR, "waitpid error: mis-matched PID (%d vs %d). programming error\n", result, pid); 127 127 exit (1); 128 128 } 129 129 if (WIFSTOPPED(waitstatus)) { 130 fprintf (stderr, "waitpid returns 'stopped': programming error\n");130 gprint (GP_ERR, "waitpid returns 'stopped': programming error\n"); 131 131 exit (1); 132 132 }
Note:
See TracChangeset
for help on using the changeset viewer.
