* strace.cc (main): Add a '-b' option.
This commit is contained in:
parent
a5cc215f75
commit
3c952fed3f
|
@ -1,3 +1,7 @@
|
|||
Fri Oct 27 20:20:29 2000 Christopher Faylor <cgf@cygnus.com>
|
||||
|
||||
* strace.cc (main): Add a '-b' option.
|
||||
|
||||
2000-10-18 DJ Delorie <dj@redhat.com>
|
||||
|
||||
* ssp.c: new
|
||||
|
|
|
@ -23,6 +23,7 @@ static int numerror = 1;
|
|||
static int usecs = 1;
|
||||
static int delta = 1;
|
||||
static int hhmmss = 0;
|
||||
static int bufsize = 0;
|
||||
|
||||
static BOOL close_handle (HANDLE h, DWORD ok);
|
||||
|
||||
|
@ -492,7 +493,8 @@ handle_output_debug_string (DWORD id, LPVOID p, unsigned mask, FILE *ofile)
|
|||
child->last_usecs = usecs;
|
||||
if (numerror || !output_winerror (ofile, s))
|
||||
fputs (s, ofile);
|
||||
fflush (ofile);
|
||||
if (!bufsize)
|
||||
fflush (ofile);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -575,12 +577,15 @@ main(int argc, char **argv)
|
|||
else
|
||||
pgm++;
|
||||
|
||||
while ((opt = getopt (argc, argv, "m:o:fndut")) != EOF)
|
||||
while ((opt = getopt (argc, argv, "b:m:o:fndut")) != EOF)
|
||||
switch (opt)
|
||||
{
|
||||
case 'f':
|
||||
forkdebug ^= 1;
|
||||
break;
|
||||
case 'b':
|
||||
bufsize = atoi (optarg);
|
||||
break;
|
||||
case 'm':
|
||||
mask = strtoul (optarg, NULL, 16);
|
||||
break;
|
||||
|
@ -607,6 +612,9 @@ main(int argc, char **argv)
|
|||
if (!mask)
|
||||
mask = 1;
|
||||
|
||||
if (bufsize)
|
||||
setvbuf (ofile, (char *) alloca (bufsize), _IOFBF, bufsize);
|
||||
|
||||
if (!ofile)
|
||||
ofile = stdout;
|
||||
|
||||
|
|
Loading…
Reference in New Issue