#include <my_global.h>#include <m_string.h>#include <my_sys.h>#include <my_getopt.h>#include <signal.h>#include <errno.h>Include dependency graph for mysql_waitpid.c:

Go to the source code of this file.
Functions | |
| void | usage (void) |
| static my_bool | get_one_option (int optid, const struct my_option *opt __attribute__((unused)), char *argument __attribute__((unused))) |
| int | main (int argc, char *argv[]) |
Variables | |
| static const char * | VER = "1.1" |
| static char * | progname |
| static my_bool | verbose |
| static struct my_option | my_long_options [] |
| static my_bool get_one_option | ( | int | optid, | |
| const struct my_option *opt | __attribute__((unused)), | |||
| char *argument | __attribute__((unused)) | |||
| ) | [static] |
Definition at line 49 of file mysql_waitpid.c.
References exit, progname, usage(), and VER.
00051 { 00052 switch(optid) { 00053 case 'V': 00054 printf("%s version %s by Jani Tolonen\n", progname, VER); 00055 exit(-1); 00056 case 'I': 00057 case '?': 00058 usage(); 00059 } 00060 return 0; 00061 }
Here is the call graph for this function:

| int main | ( | int | argc, | |
| char * | argv[] | |||
| ) |
Definition at line 64 of file mysql_waitpid.c.
References atoi(), errno, exit, get_one_option(), handle_options(), my_long_options, progname, sig(), sleep, usage(), and verbose.
00065 { 00066 int pid= 0, t= 0, sig= 0; 00067 00068 progname= argv[0]; 00069 00070 if (handle_options(&argc, &argv, my_long_options, get_one_option)) 00071 exit(-1); 00072 if (!argv[0] || !argv[1] || (pid= atoi(argv[0])) <= 0 || 00073 (t= atoi(argv[1])) <= 0) 00074 usage(); 00075 for (; t > 0; t--) 00076 { 00077 if (kill((pid_t) pid, sig)) 00078 { 00079 if (errno == EINVAL) 00080 { 00081 if (verbose) 00082 printf("WARNING: kill couldn't handle signal 0, using signal 1.\n"); 00083 sig= 1; 00084 t++; 00085 continue; 00086 } 00087 return 0; 00088 } 00089 sleep(1); 00090 } 00091 return 1; 00092 }
Here is the call graph for this function:

| void usage | ( | void | ) |
Definition at line 3308 of file mysqltest.c.
03309 { 03310 print_version(); 03311 printf("MySQL AB, by Sasha, Matt, Monty & Jani\n"); 03312 printf("This software comes with ABSOLUTELY NO WARRANTY\n\n"); 03313 printf("Runs a test against the mysql server and compares output with a results file.\n\n"); 03314 printf("Usage: %s [OPTIONS] [database] < test_file\n", my_progname); 03315 my_print_help(my_long_options); 03316 printf(" --no-defaults Don't read default options from any options file.\n"); 03317 my_print_variables(my_long_options); 03318 }
struct my_option my_long_options[] [static] |
Initial value:
{
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
0, 0, 0, 0, 0},
{"help", 'I', "Synonym for -?.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
0, 0, 0, 0, 0},
{"verbose", 'v',
"Be more verbose. Give a warning, if kill can't handle signal 0.",
(gptr*) &verbose, (gptr*) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Print version information and exit.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
}
Definition at line 34 of file mysql_waitpid.c.
char* progname [static] |
Definition at line 29 of file mysql_waitpid.c.
Referenced by get_one_option(), get_options(), main(), NDB_COMMAND(), NDB_MAIN(), and usage().
const char* VER = "1.1" [static] |
Definition at line 28 of file mysql_waitpid.c.
Definition at line 30 of file mysql_waitpid.c.
1.4.7

