int queueAddr( rodsServerHost_t *rodsServerHost, char *myHostName ) { if ( rodsServerHost == NULL || myHostName == NULL ) { return 0; } // JMC :: consider empty host for coordinating nodes if ( irods::EMPTY_RESC_HOST != myHostName ) { time_t beforeTime = time( 0 ); char canonicalName[260]; // DNS specification limits hostnames to 255-ish bytes const int ret_get_canonical_name = get_canonical_name(myHostName, canonicalName, sizeof(canonicalName)); if (ret_get_canonical_name != 0) { if ( ProcessType == SERVER_PT ) { rodsLog( LOG_NOTICE, "queueAddr: get_canonical_name error for [%s], status [%d]", myHostName, ret_get_canonical_name); } return SYS_GET_HOSTNAME_ERR; } time_t afterTime = time( 0 ); if ( afterTime - beforeTime >= 2 ) { rodsLog( LOG_NOTICE, "WARNING WARNING: get_canonical_name of %s is taking %d sec. This could severely affect interactivity of your Rods system", myHostName, afterTime - beforeTime ); /* XXXXXX may want to mark resource down later */ } if ( strcasecmp( myHostName, canonicalName ) != 0 ) { queueHostName( rodsServerHost, canonicalName, 0 ); } } return 0; }
void Mount::run_disconnect(const QString &name) { QString location = ctab.location(name).location; if (!location.length()) { return; } State state = mounts.state(location, name); if (state != connected) { emit (signal([&](){ QMessageBox msgBox; msgBox.setWindowTitle("Fail to disconnect"); msgBox.setText("You can disonnect not used drive only"); msgBox.exec(); })); return; } QString n; if (!get_canonical_name(location.toStdString(), n)) { if (n.startsWith("/dev/")) { n.remove(0, 5); while (n[n.size() - 1].category() != QChar::Letter_Lowercase) { n.resize(n.size() - 1); } do_disconnect(n); } } }