#include <stdarg.h>
#include <stdlib.h>
#include <sys/types.h>
-#ifdef HAVE_SYS_SOCKET_H
+#ifdef _WIN32
+# include <winsock2.h>
+# define SOCKET_AVAIL
+#elif defined HAVE_SYS_SOCKET_H
# include <sys/socket.h>
# include <netinet/in.h>
# include <arpa/inet.h>
#if FD_HEADER_OK
# include HEADER_FD
#endif
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
#include "i_string.h"
#include "cmdlexcl.h"
add_console(mk_console(port_number_option.get_value((long)0)));
#endif
+ /* The following code is commented out because it produces gcc warnings
+ * newcmd.cc: In member function `virtual int cl_commander::init()':
+ * newcmd.cc:785: warning: 'Config' might be used uninitialized in this function
+ * newcmd.cc:786: warning: 'cn' might be used uninitialized in this function
+ */
+ /*
char *Config= config_file_option.get_value(Config);
char *cn= console_on_option.get_value(cn);
+ */
+ /* Here shoud probably be something else, but is still better then the former code... */
+ char *Config= config_file_option.get_value("");
+ char *cn= console_on_option.get_value("");
if (cn)
{
exec_on(con, Config);
need_config= DD_FALSE;
}
- if (need_config)
+ if (need_config &&
+ Config &&
+ *Config)
{
FILE *fc= fopen(Config, "r");
if (!fc)
* Printing to actual_console
*/
+FILE *
+cl_commander::get_out(void)
+{
+ if (actual_console)
+ return(actual_console->get_out());
+ else if (frozen_console)
+ return(frozen_console->get_out());
+ return(0);
+}
+
int
cl_commander::dd_printf(char *format, ...)
{