* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#define _GNU_SOURCE
#define _LGPL_SOURCE
#include <assert.h>
#include <stdlib.h>
static const char *str_log4j = "LOG4J";
static const char *str_python = "Python";
-/*
- * get_session_name
- *
- * Return allocated string with the session name found in the config
- * directory.
- */
-char *get_session_name(void)
+static
+char *_get_session_name(int quiet)
{
char *path, *session_name = NULL;
}
/* Get session name from config */
- session_name = config_read_session_name(path);
+ session_name = quiet ? config_read_session_name_quiet(path) :
+ config_read_session_name(path);
if (session_name == NULL) {
goto error;
}
return NULL;
}
+/*
+ * get_session_name
+ *
+ * Return allocated string with the session name found in the config
+ * directory.
+ */
+char *get_session_name(void)
+{
+ return _get_session_name(0);
+}
+
+/*
+ * get_session_name_quiet (no warnings/errors emitted)
+ *
+ * Return allocated string with the session name found in the config
+ * directory.
+ */
+char *get_session_name_quiet(void)
+{
+ return _get_session_name(1);
+}
+
/*
* list_commands
*
error_socket:
return ret;
}
+
+int print_missing_or_multiple_domains(unsigned int sum)
+{
+ int ret = 0;
+
+ if (sum == 0) {
+ ERR("Please specify a domain (-k/-u/-j).");
+ ret = -1;
+ } else if (sum > 1) {
+ ERR("Multiple domains specified.");
+ ret = -1;
+ }
+
+ return ret;
+}