Пример #1
0
static int
docom1(char *comstring, int nohalt, int noprint, int doit, int nowait)
{
int status;
char *prefix;

if(comstring[0] == '\0')
	return 0;

if(!silflag && (!noprint || !doit) )
	prefix = doit ? prompt : "" ;
else
	prefix = CHNULL;

if(dynmacro(comstring) || !doit)
	{
	if(prefix)
		{
		fputs(prefix, stdout);
		puts(comstring);	/* with a newline */
		fflush(stdout);
		}
	return 0;
	}

status = dosys(comstring, nohalt, nowait, prefix);
baddirs();	/* directories may have changed */
return status;
}
Пример #2
0
static int
doall()
{
  int ret = 0;
  do
  {
    CHK2(doconnect() == 0, "connect to NDB");

    int loop = 0;
    while (++loop <= _loops)
    {
      g_info << "loop " << loop << " of " << _loops << endl;
      if (!_sys_any)
      {
        if (loop == 1)
        {
          CHK1(checkobjs() == 0);
        }
        CHK2(dostats() == 0, "at loop " << loop);
      }
      else
      {
        CHK2(dosys() == 0, "at loop " << loop);
      }
    }
    CHK1(ret == 0);
  }
  while (0);

  dodisconnect();
  return ret;
}