* 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
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 */
void output(const char* str)
{
- write(2, str, strlen(str));
+ std::cerr << 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)
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);
}