Ejemplo n.º 1
0
    void logStartup() {
        BSONObjBuilder toLog;
        stringstream id;
        id << getHostNameCached() << "-" << jsTime();
        toLog.append( "_id", id.str() );
        toLog.append( "hostname", getHostNameCached() );

        toLog.appendTimeT( "startTime", time(0) );
        toLog.append( "startTimeLocal", dateToCtimeString(curTimeMillis64()) );

        toLog.append("cmdLine", serverGlobalParams.parsedOpts);
        toLog.append( "pid", ProcessId::getCurrent().asLongLong() );


        BSONObjBuilder buildinfo( toLog.subobjStart("buildinfo"));
        appendBuildInfo(buildinfo);
        buildinfo.doneFast();

        BSONObj o = toLog.obj();

        Lock::GlobalWrite lk;
        DBDirectClient c;
        const char* name = "local.startup_log";
        c.createCollection( name, 10 * 1024 * 1024, true );
        c.insert( name, o);
    }
Ejemplo n.º 2
0
static void version(void)
{
    char *buildinfo_text = buildinfo("\n");
    printf("plink: %s\n%s\n", ver, buildinfo_text);
    sfree(buildinfo_text);
    exit(0);
}
Ejemplo n.º 3
0
static void show_version_and_exit(void)
{
    char *buildinfo_text = buildinfo("\n");
    printf("%s: %s\n%s\n", appname, ver, buildinfo_text);
    sfree(buildinfo_text);
    exit(0);
}
Ejemplo n.º 4
0
/*
 * Dialog-box function for the About box.
 */
static INT_PTR CALLBACK AboutProc(HWND hwnd,
                                  UINT msg,
                                  WPARAM wParam,
                                  LPARAM lParam)
{
  switch (msg) {
  case WM_INITDIALOG: {
    char *buildinfo_text = buildinfo("\r\n");
    char *text =
        dupprintf("Pageant\r\n\r\n%s\r\n\r\n%s\r\n\r\n%s",
                  ver,
                  buildinfo_text,
                  "\251 " SHORT_COPYRIGHT_DETAILS ". All rights reserved.");
    sfree(buildinfo_text);
    SetDlgItemText(hwnd, 1000, text);
    sfree(text);
  }
    return 1;
  case WM_COMMAND:
    switch (LOWORD(wParam)) {
    case IDOK:
    case IDCANCEL:
      aboutbox = NULL;
      DestroyWindow(hwnd);
      return 0;
    case 101:
      EnableWindow(hwnd, 0);

      // region tray-fatty
      DialogBox(hinst, MAKEINTRESOURCE(914), hwnd, LicenceProc);
      // endregion

      EnableWindow(hwnd, 1);
      SetActiveWindow(hwnd);
      return 0;
    case 102:
      /* Load web browser */
      ShellExecute(hwnd,
                   "open",
                   "https://www.chiark.greenend.org.uk/~sgtatham/putty/",
                   0,
                   0,
                   SW_SHOWDEFAULT);
      return 0;
    }
    return 0;
  case WM_CLOSE:
    aboutbox = NULL;
    DestroyWindow(hwnd);
    return 0;
  }
  return 0;
}