CVS update [cvs1-11-x-branch]: /ccvs/os2/, /ccvs/src/, /ccvs/windows-NT/
[email protected] 6 Jun 2005 21:32:53 -0000
| Newsgroups | gmane.comp.version-control.cvs.cvs |
|---|---|
| Message-ID | <[email protected]> |
Tag: cvs1-11-x-branch User: conradpino Date: 05/06/06 14:32:53 Modified: /ccvs/os2/ ChangeLog, run.c /ccvs/src/ ChangeLog, cvs.h, run.c /ccvs/windows-NT/ ChangeLog, run.c Log: * os2/run.c: Reverse patch committed 2005-05-27 by Conrad T. Pino. * src/cvs.h: Reverse patch committed 2005-05-27 by Conrad T. Pino. * src/run.c: Reverse patch committed 2005-05-27 by Conrad T. Pino. * windows-NT/run.c: Reverse patch committed 2005-05-27 by Conrad T. Pino. Move cvs1-11-x-branch-last-merge to latest branch revision on the all of the files above and corresponding ChangeLog files. File Changes: Directory: /ccvs/os2/ ===================== File [changed]: ChangeLog Url: https://ccvs.cvshome.org/source/browse/ccvs/os2/ChangeLog?r1=1.192.4.5&r2=1.192.4.6 Delta lines: +4 -0 ------------------- --- ChangeLog 28 May 2005 06:53:24 -0000 1.192.4.5 +++ ChangeLog 6 Jun 2005 21:32:50 -0000 1.192.4.6 @@ -1,3 +1,7 @@ +2005-06-06 Conrad T. Pino <[email protected]> + + * run.c: Reverse patch committed 2005-05-27 by Conrad T. Pino. + 2005-05-27 Conrad T. Pino <[email protected]> * run.c: Remove "run_arg" to synchronize with "../windows-NT/run.c". File [changed]: run.c Url: https://ccvs.cvshome.org/source/browse/ccvs/os2/run.c?r1=1.24.4.1&r2=1.24.4.2 Delta lines: +12 -4 -------------------- --- run.c 28 May 2005 06:53:24 -0000 1.24.4.1 +++ run.c 6 Jun 2005 21:32:50 -0000 1.24.4.2 @@ -31,6 +31,7 @@ #define STDOUT 1 #define STDERR 2 +static void run_add_arg PROTO((const char *s)); static void run_init_prog PROTO((void)); extern char *strtok (); @@ -41,8 +42,8 @@ * arguments will be parsed into whitespace separated words and added to the * global run_argv list. * - * Then, optionally call run_add_arg() for each additional argument that - * you'd like to pass to the executed program. + * Then, optionally call run_arg() for each additional argument that you'd like + * to pass to the executed program. * * Finally, call run_exec() to execute the program with the specified * arguments. @@ -81,6 +82,13 @@ free (run_prog) } +void +run_arg (s) + const char *s; +{ + run_add_arg (s); +} + /* Return a malloc'd copy of s, with double quotes around it. */ static char * quote (const char *s) @@ -98,7 +106,7 @@ return copy; } -void +static void run_add_arg (s) const char *s; { @@ -415,7 +423,7 @@ Return the handle of the child process (this is what _cwait and waitpid expect). */ int -piped_child (char *const *argv, int *to, int *from) +piped_child (char **argv, int *to, int *from) { fprintf (stderr, "Error: piped_child() is unimplemented.\n"); Directory: /ccvs/src/ ===================== File [changed]: ChangeLog Url: https://ccvs.cvshome.org/source/browse/ccvs/src/ChangeLog?r1=1.2336.2.379&r2=1.2336.2.380 Delta lines: +5 -0 ------------------- --- ChangeLog 2 Jun 2005 16:48:19 -0000 1.2336.2.379 +++ ChangeLog 6 Jun 2005 21:32:50 -0000 1.2336.2.380 @@ -1,3 +1,8 @@ +2005-06-06 Conrad T. Pino <[email protected]> + + * cvs.h: Reverse patch committed 2005-05-27 by Conrad T. Pino. + * run.c: Reverse patch committed 2005-05-27 by Conrad T. Pino. + 2005-06-02 Derek Price <[email protected]> * zlib.c (compress_buffer_shutdown_input): Don't attempt to read EOF File [changed]: cvs.h Url: https://ccvs.cvshome.org/source/browse/ccvs/src/cvs.h?r1=1.235.4.33&r2=1.235.4.34 Delta lines: +2 -4 ------------------- --- cvs.h 28 May 2005 06:53:25 -0000 1.235.4.33 +++ cvs.h 6 Jun 2005 21:32:50 -0000 1.235.4.34 @@ -698,19 +698,17 @@ #define RUN_SIGIGNORE 0x0010 /* ignore interrupts for command */ #define RUN_TTY (char *)0 /* for the benefit of lint */ -void run_add_arg PROTO ((const char *s)); void run_add_arg_p PROTO ((int *, size_t *, char ***, const char *s)); -#define run_arg run_add_arg void run_arg_free_p PROTO ((int, char **)); +void run_arg PROTO((const char *s)); void run_print PROTO((FILE * fp)); void run_setup PROTO ((const char *prog)); int run_exec PROTO((const char *stin, const char *stout, const char *sterr, int flags)); -int run_piped PROTO ((int *, int *)); /* other similar-minded stuff from run.c. */ FILE *run_popen PROTO((const char *, const char *)); -int piped_child PROTO((const char *const *, int *, int *)); +int piped_child PROTO((const char **, int *, int *)); void close_on_exec PROTO((int)); pid_t waitpid PROTO((pid_t, int *, int)); File [changed]: run.c Url: https://ccvs.cvshome.org/source/browse/ccvs/src/run.c?r1=1.33.6.5&r2=1.33.6.6 Delta lines: +13 -4 -------------------- --- run.c 28 May 2005 06:53:25 -0000 1.33.6.5 +++ run.c 6 Jun 2005 21:32:50 -0000 1.33.6.6 @@ -18,6 +18,8 @@ extern int execvp PROTO((char *file, char **argv)); #endif +static void run_add_arg PROTO((const char *s)); + extern char *strtok (); /* @@ -25,8 +27,8 @@ * arguments. The argument to run_setup will be parsed into whitespace * separated words and added to the global run_argv list. * - * Then, optionally call run_add_arg() for each additional argument that - * you'd like to pass to the executed program. + * Then, optionally call run_arg() for each additional argument that you'd like + * to pass to the executed program. * * Finally, call run_exec() to execute the program with the specified arguments. * The execvp() syscall will be used, so that the PATH is searched correctly. @@ -68,6 +70,13 @@ free (run_prog); } +void +run_arg (s) + const char *s; +{ + run_add_arg (s); +} + void @@ -92,7 +101,7 @@ -void +static void run_add_arg (s) const char *s; { @@ -410,7 +419,7 @@ int piped_child (command, tofdp, fromfdp) - const char *const *command; + const char **command; int *tofdp; int *fromfdp; { Directory: /ccvs/windows-NT/ ============================ File [changed]: ChangeLog Url: https://ccvs.cvshome.org/source/browse/ccvs/windows-NT/ChangeLog?r1=1.158.2.36&r2=1.158.2.37 Delta lines: +4 -0 ------------------- --- ChangeLog 28 May 2005 08:39:05 -0000 1.158.2.36 +++ ChangeLog 6 Jun 2005 21:32:51 -0000 1.158.2.37 @@ -1,3 +1,7 @@ +2005-06-06 Conrad T. Pino <[email protected]> + + * run.c: Reverse patch committed 2005-05-27 by Conrad T. Pino. + 2005-05-28 Conrad T. Pino <[email protected]> * run.c: Substitute "xrealloc" function for "xnrealloc" call from File [changed]: run.c Url: https://ccvs.cvshome.org/source/browse/ccvs/windows-NT/run.c?r1=1.16.8.4&r2=1.16.8.5 Delta lines: +39 -52 --------------------- --- run.c 28 May 2005 08:39:05 -0000 1.16.8.4 +++ run.c 6 Jun 2005 21:32:51 -0000 1.16.8.5 @@ -22,7 +22,10 @@ #include <io.h> #include <fcntl.h> +static void run_add_arg PROTO((const char *s)); +static void run_init_prog PROTO((void)); +extern char *strtok (); /* * To exec a program under CVS, first call run_setup() to setup any initial @@ -39,21 +42,8 @@ */ static char **run_argv; static int run_argc; -static size_t run_arg_allocated; +static int run_argc_allocated; - - -void -run_arg_free_p (int argc, char **argv) -{ - int i; - for (i = 0; i < argc; i++) - free (argv[i]); -} - - - -/* VARARGS */ void run_setup (const char *prog) { @@ -82,7 +72,12 @@ free (run_prog); } - +void +run_arg (s) + const char *s; +{ + run_add_arg (s); +} /* Return a malloc'd copy of s, with double quotes around it. */ static char * @@ -113,37 +108,33 @@ return copy; } - - -void -run_add_arg_p (int *iargc, size_t *iarg_allocated, char ***iargv, - const char *s) +static void +run_add_arg (s) + const char *s; { /* allocate more argv entries if we've run out */ - if (*iargc >= *iarg_allocated) + if (run_argc >= run_argc_allocated) { - *iarg_allocated += 50; - *iargv = xrealloc (*iargv, *iarg_allocated * sizeof (char **)); + run_argc_allocated += 50; + run_argv = (char **) xrealloc ((char *) run_argv, + run_argc_allocated * sizeof (char **)); } if (s) - (*iargv)[(*iargc)++] = xstrdup (s); + { + run_argv[run_argc] = (run_argc ? quote (s) : xstrdup (s)); + run_argc++; + } else - (*iargv)[*iargc] = NULL; /* not post-incremented on purpose! */ + run_argv[run_argc] = (char *) 0; /* not post-incremented on purpose! */ } - - -void -run_add_arg (const char *s) -{ - run_add_arg_p (&run_argc, &run_arg_allocated, &run_argv, s); -} - - - int -run_exec (const char *stin, const char *stout, const char *sterr, int flags) +run_exec (stin, stout, sterr, flags) + const char *stin; + const char *stout; + const char *sterr; + int flags; { int shin, shout, sherr; int sain, saout, saerr; /* saved handles */ @@ -292,7 +283,8 @@ } void -run_print (FILE *fp) +run_print (fp) + FILE *fp; { int i; @@ -320,7 +312,9 @@ } FILE * -run_popen (const char *cmd, const char *mode) +run_popen (cmd, mode) + const char *cmd; + const char *mode; { if (trace) #ifdef SERVER_SUPPORT @@ -530,7 +524,7 @@ construct a command line that one might pass to CreateProcess. Try to quote things appropriately. */ static char * -build_command (char *const *argv) +build_command (char **argv) { int len; @@ -603,7 +597,7 @@ Return the handle of the child process (this is what _cwait and waitpid expect). */ int -piped_child (char *const *argv, int *to, int *from) +piped_child (const char **argv, int *to, int *from) { int child; HANDLE pipein[2], pipeout[2]; @@ -611,7 +605,7 @@ /* Turn argv into a form acceptable to CreateProcess. */ command = build_command (argv); - if (!command) + if (! command) return -1; /* Create pipes for communicating with child. Arrange for @@ -647,7 +641,10 @@ */ int -filter_stream_through_program (int oldfd, int dir, char **prog, pid_t *pidp) +filter_stream_through_program (oldfd, dir, prog, pidp) + int oldfd, dir; + char **prog; + pid_t *pidp; { HANDLE pipe[2]; char *command; @@ -700,16 +697,6 @@ } - -int -run_piped (int *tofdp, int *fromfdp) -{ - run_add_arg (NULL); - return piped_child (run_argv, tofdp, fromfdp); -} - - - /* Arrange for the file descriptor FD to not be inherited by child processes. At the moment, CVS uses this function only on pipes returned by piped_child, and our implementation of piped_child