/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2008 Index Data
+ * Copyright (C) 1995-2010 Index Data
* See the file LICENSE for details.
*/
#include <yaz/comstack.h>
#include <yaz/tcpip.h>
#include <yaz/options.h>
+#include <yaz/errno.h>
#ifdef USE_XTIMOSI
#include <yaz/xmosi.h>
#endif
static void *new_session(void *vp)
{
- char *a;
+ const char *a;
association *newas;
IOCHAN new_chan;
COMSTACK new_line = (COMSTACK) vp;
COMSTACK line;
IOCHAN chan;
association *assoc;
- char *addr;
+ const char *addr;
if ((line = cs_createbysocket(0, tcpip_type, 0, what)))
{
void statserv_setcontrol(statserv_options_block *block)
{
- chdir(gfs_root_dir);
+ if (gfs_root_dir[0])
+ {
+ if (chdir(gfs_root_dir))
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "chdir %s", gfs_root_dir);
+ }
#ifdef WIN32
if (init_control_tls)
TlsSetValue(current_control_tls, block);
close(1);
close(2);
open("/dev/null", O_RDWR);
- dup(0); dup(0);
+ if (dup(0) == -1)
+ return 1;
+ if (dup(0) == -1)
+ return 1;
}
xml_config_add_listeners();
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab