projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make som internal functions static.
[yaz-moved-to-github.git]
/
src
/
statserv.c
diff --git
a/src/statserv.c
b/src/statserv.c
index
00ba31c
..
2789a9b
100644
(file)
--- a/
src/statserv.c
+++ b/
src/statserv.c
@@
-1,5
+1,5
@@
/* This file is part of the YAZ toolkit.
/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2008 Index Data
+ * Copyright (C) 1995-2009 Index Data
* See the file LICENSE for details.
*/
* See the file LICENSE for details.
*/
@@
-53,6
+53,7
@@
#include <yaz/comstack.h>
#include <yaz/tcpip.h>
#include <yaz/options.h>
#include <yaz/comstack.h>
#include <yaz/tcpip.h>
#include <yaz/options.h>
+#include <yaz/errno.h>
#ifdef USE_XTIMOSI
#include <yaz/xmosi.h>
#endif
#ifdef USE_XTIMOSI
#include <yaz/xmosi.h>
#endif
@@
-1184,7
+1185,11
@@
statserv_options_block *statserv_getcontrol(void)
void statserv_setcontrol(statserv_options_block *block)
{
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);
#ifdef WIN32
if (init_control_tls)
TlsSetValue(current_control_tls, block);
@@
-1282,7
+1287,10
@@
static int statserv_sc_main(yaz_sc_t s, int argc, char **argv)
close(1);
close(2);
open("/dev/null", O_RDWR);
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();
}
xml_config_add_listeners();
@@
-1524,6
+1532,7
@@
int statserv_main(int argc, char **argv,
/*
* Local variables:
* c-basic-offset: 4
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab