Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit d16fddb8 authored by rswindell's avatar rswindell

Created STRERROR macro that truncates whitespace only in non-Unix build.

parent 27c70b57
......@@ -70,7 +70,7 @@ BOOL read_node_cfg(scfg_t* cfg, char* error)
strcpy(fname,"node.cnf");
sprintf(str,"%s%s",cfg->node_dir,fname);
if((instream=fnopen(NULL,str,O_RDONLY))==NULL) {
sprintf(error,"%d (%s) opening %s",errno,truncsp(strerror(errno)),str);
sprintf(error,"%d (%s) opening %s",errno,STRERROR(errno),str);
return(FALSE);
}
......@@ -188,7 +188,7 @@ BOOL read_main_cfg(scfg_t* cfg, char* error)
strcpy(fname,"main.cnf");
sprintf(str,"%s%s",cfg->ctrl_dir,fname);
if((instream=fnopen(NULL,str,O_RDONLY))==NULL) {
sprintf(error,"%d (%s) opening %s",errno,truncsp(strerror(errno)),str);
sprintf(error,"%d (%s) opening %s",errno,STRERROR(errno),str);
return(FALSE);
}
......@@ -410,7 +410,7 @@ BOOL read_msgs_cfg(scfg_t* cfg, char* error)
strcpy(fname,"msgs.cnf");
sprintf(str,"%s%s",cfg->ctrl_dir,fname);
if((instream=fnopen(NULL,str,O_RDONLY))==NULL) {
sprintf(error,"%d (%s) opening %s",errno,truncsp(strerror(errno)),str);
sprintf(error,"%d (%s) opening %s",errno,STRERROR(errno),str);
return(FALSE);
}
......
......@@ -51,7 +51,7 @@ BOOL read_file_cfg(scfg_t* cfg, char* error)
strcpy(fname,"file.cnf");
sprintf(str,"%s%s",cfg->ctrl_dir,fname);
if((instream=fnopen(NULL,str,O_RDONLY))==NULL) {
sprintf(error,"%d (%s) opening %s",errno,truncsp(strerror(errno)),str);
sprintf(error,"%d (%s) opening %s",errno,STRERROR(errno),str);
return(FALSE);
}
......@@ -440,7 +440,7 @@ BOOL read_xtrn_cfg(scfg_t* cfg, char* error)
strcpy(fname,"xtrn.cnf");
sprintf(str,"%s%s",cfg->ctrl_dir,fname);
if((instream=fnopen(NULL,str,O_RDONLY))==NULL) {
sprintf(error,"%d (%s) opening %s",errno,truncsp(strerror(errno)),str);
sprintf(error,"%d (%s) opening %s",errno,STRERROR(errno),str);
return(FALSE);
}
......@@ -674,7 +674,7 @@ BOOL read_chat_cfg(scfg_t* cfg, char* error)
strcpy(fname,"chat.cnf");
sprintf(str,"%s%s",cfg->ctrl_dir,fname);
if((instream=fnopen(NULL,str,O_RDONLY))==NULL) {
sprintf(error,"%d (%s) opening %s",errno,truncsp(strerror(errno)),str);
sprintf(error,"%d (%s) opening %s",errno,STRERROR(errno),str);
return(FALSE);
}
......
......@@ -134,6 +134,12 @@ extern "C" {
#endif
#endif
#if defined(__unix__)
#define STRERROR(x) strerror(x)
#else
#define STRERROR(x) truncsp(strerror(x))
#endif
/****************************/
/* Common Utility Functions */
/****************************/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment