Logging changes

This commit is contained in:
Michiel Broek
2002-05-10 18:14:27 +00:00
parent c2392faf05
commit 0f2277e9b9
14 changed files with 38 additions and 18 deletions

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -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);
}