projects
/
gnucomo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f5dbf94
)
Configuration file in /etc, status files in /var/lib
author
arjen
<arjen>
Tue, 31 May 2005 05:47:33 +0000
(
05:47
+0000)
committer
arjen
<arjen>
Tue, 31 May 2005 05:47:33 +0000
(
05:47
+0000)
src/gcm_input/logrunner.cpp
patch
|
blob
|
history
diff --git
a/src/gcm_input/logrunner.cpp
b/src/gcm_input/logrunner.cpp
index
4968579
..
f4d0ecd
100644
(file)
--- a/
src/gcm_input/logrunner.cpp
+++ b/
src/gcm_input/logrunner.cpp
@@
-2,7
+2,7
@@
* logrunner.c
* (c) Peter Roozemaal, feb 2003
*
* logrunner.c
* (c) Peter Roozemaal, feb 2003
*
- * $Id: logrunner.cpp,v 1.
1 2003-08-11 16:56:16
arjen Exp $
+ * $Id: logrunner.cpp,v 1.
2 2005-05-31 05:47:33
arjen Exp $
*
* 1) compile,
* 2) create 'logrunner.conf' containing a list of filenames and types of the
*
* 1) compile,
* 2) create 'logrunner.conf' containing a list of filenames and types of the
@@
-49,9
+49,9
@@
struct fileinfo {
off_t position;
};
off_t position;
};
-
static const char* confname = "
logrunner.conf";
-static const char* statusname = "logrunner.status";
-static const char* newstatusname = "logrunner.status.new";
+
String confname = "/etc/
logrunner.conf";
+static const char* statusname = "
/var/lib/
logrunner.status";
+static const char* newstatusname = "
/var/lib/
logrunner.status.new";
static const char *hostname = NULL;
static int port = 2996; /* random magic number */
static const char *hostname = NULL;
static int port = 2996; /* random magic number */
@@
-143,15
+143,12
@@
void xml_footer(void)
void output(const char* str)
{
void output(const char* str)
{
-
write(2, str, strlen(str))
;
+
std::cerr << str
;
}
void output_error(const char* str)
{
}
void output_error(const char* str)
{
- char error[80];
- sprintf(error, " errno=%d\n", errno);
- output(str);
- output(error);
+ std::cerr << str << " errno=" << errno << "\n";
}
void write_status_file(struct fileinfo* fl)
}
void write_status_file(struct fileinfo* fl)
@@
-263,9
+260,7
@@
void read_config()
conffile = fopen(confname, "r");
if ( !conffile )
{
conffile = fopen(confname, "r");
if ( !conffile )
{
- fprintf(stderr,
- "logrunner: can\'t open configuration file \'%s\': ",
- confname);
+ std::cerr << "logrunner: can\'t open configuration file \'" << confname << "\': ";
perror("");
exit(2);
}
perror("");
exit(2);
}