Removed some sync calls

This commit is contained in:
Michiel Broek 2004-01-18 13:28:25 +00:00
parent 6e1108f1b3
commit baa8a4d09f
8 changed files with 21 additions and 22 deletions

View File

@ -7,6 +7,15 @@ v0.39.7 14-Jan-2004
and after running the external program to make sure diskbuffers and after running the external program to make sure diskbuffers
are committed. are committed.
mbfido:
Removed sync calls that are now in execute.
mbfile:
Removed sync calls that are now in execute.
mbdiff:
Removed sync calls that are now in execute.
v0.39.6 11-Jan-2004 - 14-Jan-2004 v0.39.6 11-Jan-2004 - 14-Jan-2004

View File

@ -4,7 +4,7 @@
* Purpose ...............: .TIC files magic processing. * Purpose ...............: .TIC files magic processing.
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2002 * Copyright (C) 1997-2004
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -292,7 +292,6 @@ void Magic_UnpackFile(void)
cmd = xstrcpy(archiver.munarc); cmd = xstrcpy(archiver.munarc);
if (strlen(cmd)) { if (strlen(cmd)) {
rc = execute(cmd, Fn, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null"); rc = execute(cmd, Fn, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null");
sync();
if (rc) if (rc)
WriteError("$Magic: unpack in %s, error %d", magic.Path, rc); WriteError("$Magic: unpack in %s, error %d", magic.Path, rc);
else else

View File

@ -293,7 +293,7 @@ int main(int argc, char **argv)
} }
if (execute(cmd, nd, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null")) { if (execute(cmd, nd, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null")) {
Syslog('!', "Warning: unpack error, trying again after a sync"); WriteError("Warning: unpack error, trying again after a sync");
sync(); sync();
sleep(1); sleep(1);
if (execute(cmd, nd, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null")) { if (execute(cmd, nd, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null")) {
@ -307,7 +307,6 @@ int main(int argc, char **argv)
} }
} }
free(cmd); free(cmd);
sync();
Match = FALSE; Match = FALSE;
if ((dp = opendir(wrk)) != NULL) { if ((dp = opendir(wrk)) != NULL) {
@ -417,7 +416,6 @@ int main(int argc, char **argv)
else { else {
CreateSema((char *)"mailin"); CreateSema((char *)"mailin");
} }
sync();
free(p); free(p);
free(cmd); free(cmd);
} }

View File

@ -4,7 +4,7 @@
* Purpose: Process Fidonet style mail and files. * Purpose: Process Fidonet style mail and files.
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2002 * Copyright (C) 1997-2004
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -690,7 +690,6 @@ int TossMail(void)
if (checkspace(inbound, fname, UNPACK_FACTOR)) if (checkspace(inbound, fname, UNPACK_FACTOR))
if ((rc = unpack(fname)) == 0) { if ((rc = unpack(fname)) == 0) {
files_ok++; files_ok++;
sync();
rc = TossPkts(); rc = TossPkts();
chdir(inbound); chdir(inbound);
} else } else

View File

@ -4,7 +4,7 @@
* Purpose: File Database Maintenance - utilities * Purpose: File Database Maintenance - utilities
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2003 * Copyright (C) 1997-2004
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -292,14 +292,12 @@ int UnpackFile(char *File)
free(temp); free(temp);
free(pwd); free(pwd);
free(cmd); free(cmd);
sync();
return TRUE; return TRUE;
} else { } else {
chdir(pwd); chdir(pwd);
WriteError("Unpack error, file may be corrupt"); WriteError("Unpack error, file may be corrupt");
DeleteVirusWork(); DeleteVirusWork();
} }
sync();
return FALSE; return FALSE;
} }

View File

@ -4,7 +4,7 @@
* Purpose ...............: Process 1 .tic file * Purpose ...............: Process 1 .tic file
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2002 * Copyright (C) 1997-2004
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -488,7 +488,6 @@ int ProcessTic(fa_list *sbl)
} else { } else {
sprintf(temp1, "%s/%s", TIC.Inbound, TIC.TicIn.File); sprintf(temp1, "%s/%s", TIC.Inbound, TIC.TicIn.File);
if (execute(cmd, temp1, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null") == 0) { if (execute(cmd, temp1, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null") == 0) {
sync();
UnPacked = TRUE; UnPacked = TRUE;
} else { } else {
chdir(TIC.Inbound); chdir(TIC.Inbound);
@ -574,12 +573,10 @@ int ProcessTic(fa_list *sbl)
chdir(temp1); chdir(temp1);
sprintf(temp1, "%s/%s FILE_ID.DIZ", TIC.Inbound, TIC.TicIn.File); sprintf(temp1, "%s/%s FILE_ID.DIZ", TIC.Inbound, TIC.TicIn.File);
if (execute(cmd, temp1, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null") == 0) { if (execute(cmd, temp1, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null") == 0) {
sync();
File_Id = TRUE; File_Id = TRUE;
} else { } else {
sprintf(temp1, "%s/%s file_id.diz", TIC.Inbound, TIC.TicIn.File); sprintf(temp1, "%s/%s file_id.diz", TIC.Inbound, TIC.TicIn.File);
if (execute(cmd, temp1, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null") == 0) { if (execute(cmd, temp1, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null") == 0) {
sync();
File_Id = TRUE; File_Id = TRUE;
} }
} }
@ -670,7 +667,6 @@ int ProcessTic(fa_list *sbl)
if (execute(cmd, temp1, (char *)NULL, Temp, (char *)"/dev/null", (char *)"/dev/null")) { if (execute(cmd, temp1, (char *)NULL, Temp, (char *)"/dev/null", (char *)"/dev/null")) {
WriteError("$Changing the banner failed"); WriteError("$Changing the banner failed");
} else { } else {
sync();
Syslog('+', "New banner %s", tic.Banner); Syslog('+', "New banner %s", tic.Banner);
TIC.FileSize = file_size(temp1); TIC.FileSize = file_size(temp1);
T_File.Size = TIC.FileSize; T_File.Size = TIC.FileSize;

View File

@ -4,7 +4,7 @@
* Purpose ...............: Mail and file queue operations * Purpose ...............: Mail and file queue operations
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2002 * Copyright (C) 1997-2004
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -392,7 +392,7 @@ void flush_dir(char *ndir)
if (execute(archiver.marc, arcfile, fname, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null") == 0) { if (execute(archiver.marc, arcfile, fname, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null") == 0) {
unlink(fname); unlink(fname);
} else { } else {
Syslog('+', "Create ARCmail failed, trying again after sync()"); WriteError("Create ARCmail failed, trying again after sync()");
sync(); sync();
sleep(1); sleep(1);
if (execute(archiver.marc, arcfile, fname, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null") == 0) { if (execute(archiver.marc, arcfile, fname, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null") == 0) {

View File

@ -4,7 +4,7 @@
* Purpose ...............: Unpacker * Purpose ...............: Unpacker
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2002 * Copyright (C) 1997-2004
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -96,17 +96,17 @@ int unpack(char *fn)
} }
if ((rc = execute(cmd,fn,(char *)NULL,(char*)"/dev/null",(char*)"/dev/null",(char*)"/dev/null")) == 0) { if ((rc = execute(cmd,fn,(char *)NULL,(char*)"/dev/null",(char*)"/dev/null",(char*)"/dev/null")) == 0) {
sync(); // sync();
unlink(fn); unlink(fn);
} else { } else {
sync(); sync();
sleep(1); sleep(1);
Syslog('!', "Warning: unpack %s failed, trying again after sync()", fn); WriteError("Warning: unpack %s failed, trying again after sync()", fn);
if ((rc = execute(cmd,fn,(char *)NULL,(char*)"/dev/null",(char*)"/dev/null",(char*)"/dev/null")) == 0) { if ((rc = execute(cmd,fn,(char *)NULL,(char*)"/dev/null",(char*)"/dev/null",(char*)"/dev/null")) == 0) {
sync(); // sync();
unlink(fn); unlink(fn);
} else { } else {
sync(); // sync();
strncpy(newname,fn,sizeof(newname)-1); strncpy(newname,fn,sizeof(newname)-1);
strcpy(newname+8,".bad"); strcpy(newname+8,".bad");
rename(fn,newname); rename(fn,newname);