Priority:
For 1.39:
+- Fix wx-console scanning problem with commas in names.
- Change dbcheck to tell users to use native tools for fixing
broken databases, and to ensure they have the proper indexes.
- add udev rules for Bacula devices.
- Update llist to include new fields.
- Make unmount unload autochanger. Make mount load slot.
- Fix bscan to report the JobType when restoring a job.
-
#define usrbrk() 0
#endif
-#ifdef HAVE_WIN32
+#if defined(HAVE_WIN32)
#define isatty(fd) (fd==0)
#endif
static FILE *output = stdout;
static bool teeout = false; /* output to output and stdout */
static bool stop = false;
+static bool no_conio = false;
static int argc;
static int numdir;
static POOLMEM *args;
"Usage: bconsole [-s] [-c config_file] [-d debug_level]\n"
" -c <file> set configuration file to file\n"
" -dnn set debug level to nn\n"
+" -n no conio\n"
" -s no signals\n"
" -t test - read configuration and exit\n"
" -? print this message.\n"
init_msg(NULL, NULL);
working_directory = "/tmp";
args = get_pool_memory(PM_FNAME);
- con_init(stdin);
- while ((ch = getopt(argc, argv, "bc:d:r:st?")) != -1) {
+ while ((ch = getopt(argc, argv, "bc:d:nst?")) != -1) {
switch (ch) {
case 'c': /* configuration file */
if (configfile != NULL) {
}
break;
+ case 'n': /* no conio */
+ no_conio = true;
+ break;
+
case 's': /* turn off signals */
no_signals = true;
break;
case '?':
default:
usage();
- con_term();
exit(1);
}
}
if (argc) {
usage();
- con_term();
exit(1);
}
Emsg1(M_ERROR_TERM, 0, _("Please correct configuration file: %s\n"), configfile);
}
+ if (!no_conio) {
+ con_init(stdin);
+ }
+
if (test_config) {
terminate_console(0);
exit(0);
already_here = true;
cleanup_crypto();
free_pool_memory(args);
- con_term();
+ if (!no_conio) {
+ con_term();
+ }
(void)WSACleanup(); /* Cleanup Windows sockets */
if (sig != 0) {
exit(1);
#else /* no readline, do it ourselves */
+static bool bisatty(int fd)
+{
+ if (no_conio) {
+ return false;
+ }
+ return isatty(fd);
+}
+
/*
* Returns: 1 if data available
* 0 if timeout
static int
wait_for_data(int fd, int sec)
{
+#if defined(HAVE_WIN32)
+ return 1;
+#else
fd_set fdset;
struct timeval tv;
-#ifdef HAVE_WIN32
- return 1; /* select doesn't seem to work on Win32 */
-#endif
tv.tv_sec = sec;
tv.tv_usec = 0;
return 1;
}
}
+#endif
}
/*
goto again;
}
#ifdef HAVE_CONIO
- if (isatty(fileno(input))) {
+ if (bisatty(fileno(input))) {
input_line(sock->msg, len);
break;
}
return 1;
}
-#endif
+#endif /* end non-readline code */
static int versioncmd(FILE *input, BSOCK *UA_sock)
{