Logging changes
This commit is contained in:
@@ -70,7 +70,7 @@ void die(int onsig)
|
||||
|
||||
if (onsig) {
|
||||
if (onsig <= NSIG)
|
||||
WriteError("$Terminated on signal %d (%s)", onsig, SigName[onsig]);
|
||||
WriteError("Terminated on signal %d (%s)", onsig, SigName[onsig]);
|
||||
else
|
||||
WriteError("Terminated with error %d", onsig);
|
||||
}
|
||||
|
@@ -94,7 +94,7 @@ void die(int onsig)
|
||||
|
||||
if (onsig) {
|
||||
if (onsig <= NSIG)
|
||||
WriteError("$Terminated on signal %d (%s)", onsig, SigName[onsig]);
|
||||
WriteError("Terminated on signal %d (%s)", onsig, SigName[onsig]);
|
||||
else
|
||||
WriteError("Terminated with error %d", onsig);
|
||||
}
|
||||
|
@@ -52,7 +52,7 @@ void AdoptFile(int Area, char *File, char *Description)
|
||||
char Desc[256], TDesc[256];
|
||||
int IsArchive = FALSE, MustRearc = FALSE, UnPacked = FALSE;
|
||||
int IsVirus = FALSE, File_Id = FALSE;
|
||||
int i, j, k, lines = 0, File_id_cnt = 0;
|
||||
int i, j, k, lines = 0, File_id_cnt = 0, rc;
|
||||
struct FILERecord fdb;
|
||||
|
||||
Syslog('-', "Adopt(%d, %s, %s)", Area, MBSE_SS(File), MBSE_SS(Description));
|
||||
@@ -83,10 +83,10 @@ void AdoptFile(int Area, char *File, char *Description)
|
||||
Syslog('+', "No known archive: %s", File);
|
||||
sprintf(temp2, "%s/tmp/arc/%s", getenv("MBSE_ROOT"), File);
|
||||
mkdirs(temp2, 0755);
|
||||
if (file_cp(temp, temp2)) {
|
||||
if ((rc = file_cp(temp, temp2))) {
|
||||
WriteError("Can't copy file to %s", temp2);
|
||||
if (!do_quiet)
|
||||
printf("Can't copy file to %s\n", temp2);
|
||||
printf("Can't copy file to %s, %s\n", temp2, strerror(rc));
|
||||
die(0);
|
||||
} else {
|
||||
if (!do_quiet) {
|
||||
|
@@ -49,7 +49,7 @@ void ImportFiles(int Area)
|
||||
{
|
||||
char *pwd, *temp, *temp2, *String, *token, *dest, *unarc;
|
||||
FILE *fbbs;
|
||||
int Append = FALSE, Files = 0, i, j = 0, k = 0, x, Doit;
|
||||
int Append = FALSE, Files = 0, rc, i, j = 0, k = 0, x, Doit;
|
||||
int Imported = 0, Errors = 0, Present = FALSE;
|
||||
struct FILERecord fdb;
|
||||
struct stat statfile;
|
||||
@@ -104,8 +104,10 @@ void ImportFiles(int Area)
|
||||
Syslog('+', "Unknown archive format %s", temp);
|
||||
sprintf(temp2, "%s/tmp/arc/%s", getenv("MBSE_ROOT"), fdb.LName);
|
||||
mkdirs(temp2, 0755);
|
||||
if (file_cp(temp, temp2)) {
|
||||
if ((rc = file_cp(temp, temp2))) {
|
||||
WriteError("Can't copy file to %s", temp2);
|
||||
if (!do_quiet)
|
||||
printf("Can't copy file to %s, %s\n", temp2, strerror(rc));
|
||||
Doit = FALSE;
|
||||
} else {
|
||||
if (!do_quiet) {
|
||||
|
@@ -87,7 +87,7 @@ void die(int onsig)
|
||||
|
||||
if (onsig) {
|
||||
if (onsig <= NSIG)
|
||||
WriteError("$Terminated on signal %d (%s)", onsig, SigName[onsig]);
|
||||
WriteError("Terminated on signal %d (%s)", onsig, SigName[onsig]);
|
||||
else
|
||||
WriteError("Terminated with error %d", onsig);
|
||||
}
|
||||
@@ -309,11 +309,13 @@ int AddFile(struct FILERecord fdb, int Area, char *DestPath, char *FromPath)
|
||||
{
|
||||
char *temp1, *temp2;
|
||||
FILE *fp1, *fp2;
|
||||
int i, Insert, Done = FALSE, Found = FALSE;
|
||||
int i, rc, Insert, Done = FALSE, Found = FALSE;
|
||||
|
||||
mkdirs(DestPath, 0755);
|
||||
if (file_cp(FromPath, DestPath)) {
|
||||
if ((rc = file_cp(FromPath, DestPath))) {
|
||||
WriteError("Can't move file in place");
|
||||
if (!do_quiet)
|
||||
printf("Can't copy file to %s, %s\n", temp2, strerror(rc));
|
||||
return FALSE;
|
||||
}
|
||||
chmod(DestPath, 0644);
|
||||
|
@@ -188,7 +188,7 @@ void die(int onsig)
|
||||
|
||||
if (onsig) {
|
||||
if (onsig <= NSIG)
|
||||
WriteError("$Terminated on signal %d (%s)", onsig, SigName[onsig]);
|
||||
WriteError("Terminated on signal %d (%s)", onsig, SigName[onsig]);
|
||||
else
|
||||
WriteError("Terminated with error %d", onsig);
|
||||
}
|
||||
|
@@ -223,7 +223,7 @@ void die(int onsig)
|
||||
|
||||
if (onsig) {
|
||||
if (onsig <= NSIG)
|
||||
WriteError("$Terminated on signal %d (%s)", onsig, SigName[onsig]);
|
||||
WriteError("Terminated on signal %d (%s)", onsig, SigName[onsig]);
|
||||
else
|
||||
WriteError("Terminated with error %d", onsig);
|
||||
}
|
||||
|
Reference in New Issue
Block a user