Changeset 1554


Ignore:
Timestamp:
Nov 21, 2010, 12:35:35 AM (15 years ago)
Author:
Gregg Young
Message:

Check that pTmpDir IsValid and recreate if not found; Fixes hangs caused by temp file creation failures. (Ticket 440)

Location:
trunk/dll
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/arccnrs.c

    r1545 r1554  
    8484  15 Apr 10 JBS Ticket 422: Stop hang when open archive gets deleted or moved
    8585  23 Oct 10 GKY Add ForwardslashToBackslash function to streamline code
     86  20 Nov 10 GKY Check that pTmpDir IsValid and recreate if not found; Fixes hangs caused
     87                by temp file creation failures.
    8688
    8789***********************************************************************/
     
    20212023                CHAR *modew = "w";
    20222024
     2025                if (pTmpDir && !IsValidDir(pTmpDir))
     2026                  DosCreateDir(pTmpDir, 0);
    20232027                BldFullPathName(szTempFile, pTmpDir, PCSZ_FM2PLAYTEMP);
    20242028                fp = xfopen(szTempFile, modew, pszSrcFile, __LINE__, FALSE);
     
    36503654        dcd->id = id;
    36513655        dcd->type = ARC_FRAME;
    3652         if (!pTmpDir)
    3653           strcpy(dcd->workdir, pFM2SaveDirectory);
     3656        if (pTmpDir && !IsValidDir(pTmpDir))
     3657          DosCreateDir(pTmpDir, 0);
    36543658        MakeTempName(dcd->workdir, ArcTempRoot, 2);
    36553659        strcpy(dcd->arcname, fullname);
  • trunk/dll/dirsize.c

    r1544 r1554  
    5151                aren't user settable; realappname should be used for setting applicable to
    5252                one or more miniapp but not to FM/2
    53   17 JAN 10 GKY Changes to get working with Watcom 1.9 Beta (1/16/10). Mostly cast CHAR CONSTANT * as CHAR *.
     53  17 JAN 10 GKY Changes to get working with Watcom 1.9 Beta (1/16/10).
     54                Mostly cast CHAR CONSTANT * as CHAR *.
     55  20 Nov 10 GKY Check that pTmpDir IsValid and recreate if not found; Fixes hangs caused
     56                by temp file creation failures.
    5457
    5558***********************************************************************/
     
    957960        CHAR *modea = "a+";
    958961
    959         if (pTmpDir)
    960           strcpy(szFileName, pTmpDir);
    961         else
     962        if (pTmpDir && !IsValidDir(pTmpDir))
     963          DosCreateDir(pTmpDir, 0);
     964        //if (pTmpDir)
     965        //  strcpy(szFileName, pTmpDir);
     966        else if (!pTmpDir)
    962967          strcpy(szFileName, pFM2SaveDirectory);
    963968        sprintf(&szFileName[strlen(szFileName)], "%s%csizes.Rpt", PCSZ_BACKSLASH,
  • trunk/dll/inis.c

    r1545 r1554  
    3838  17 JAN 10 GKY Changes to get working with Watcom 1.9 Beta (1/16/10). Mostly cast CHAR CONSTANT * as CHAR *.
    3939  23 Oct 10 GKY Add ForwardslashToBackslash function to streamline code
     40  20 Nov 10 GKY Check that pTmpDir IsValid and recreate if not found; Fixes hangs caused
     41                by temp file creation failures.
    4042
    4143***********************************************************************/
     
    11781180        /* make copies of new inis */
    11791181        *tempuserini = 0;
    1180         *tempsysini = 0;
     1182        *tempsysini = 0;
     1183        if (pTmpDir && !IsValidDir(pTmpDir))
     1184          DosCreateDir(pTmpDir, 0);
    11811185        BldFullPathName(tempuserini, pTmpDir ? pTmpDir : pFM2SaveDirectory, "TEMPUSER.INI");
    11821186        rc = DosCopy(userini, tempuserini, DCPY_EXISTING);
     
    11891193                    GetPString(IDS_COMPCOPYFAILEDTEXT), userini, tempuserini);
    11901194          break;
    1191         }
     1195        }
     1196        if (pTmpDir && !IsValidDir(pTmpDir))
     1197          DosCreateDir(pTmpDir, 0);
    11921198        BldFullPathName(tempsysini, pTmpDir ? pTmpDir : pFM2SaveDirectory, "TEMPSYS.INI");
    11931199        rc = DosCopy(sysini, tempsysini, DCPY_EXISTING);
  • trunk/dll/init.c

    r1553 r1554  
    101101                entries in the tree container, fix related semaphore performance using
    102102                combination of event and mutex semaphores
     103  20 Nov 10 GKY Check that pTmpDir IsValid and recreate if not found; Fixes hangs caused
     104                by temp file creation failures.
    103105
    104106***********************************************************************/
     
    582584    strcpy(s, pFM2SaveDirectory);
    583585  AddBackslashToPath(s);
    584   //if (s[strlen(s) - 1] != '\\')
    585   //  strcat(s, "\\");
    586586  enddir = &s[strlen(s)];
    587587  strcat(s, "$FM2LI$T.");
     
    729729      ULONG num_matches, ul;
    730730
     731      //Save the FM2 save directory name. This is the location of the ini, dat files etc.
     732      save_dir2(temp);
     733      pFM2SaveDirectory = xstrdup(temp, pszSrcFile, __LINE__);
    731734      strcpy(szTempName, env);
    732735      AddBackslashToPath(szTempName);
     
    767770        rc = DosCreateDir(szTempName, 0);
    768771        if (!rc)
    769           pTmpDir = xstrdup(szTempName, pszSrcFile, __LINE__);  // if writable
     772          pTmpDir = xstrdup(szTempName, pszSrcFile, __LINE__);  // if writable
     773        else
     774          pTmpDir = xstrdup(pFM2SaveDirectory, pszSrcFile, __LINE__);
    770775        }
    771776      }
    772777    }
    773 
    774   //Save the FM2 save directory name. This is the location of the ini, dat files etc.
    775   {
    776     CHAR temp[CCHMAXPATH];
    777     save_dir2(temp);
    778     pFM2SaveDirectory = xstrdup(temp, pszSrcFile, __LINE__);
    779   }
    780778  // Check free space on TMP and FM2 Save drives
    781779  {
  • trunk/dll/killproc.c

    r1544 r1554  
    2727                aren't user settable; realappname should be used for setting applicable to
    2828                one or more miniapp but not to FM/2
    29   17 JAN 10 GKY Changes to get working with Watcom 1.9 Beta (1/16/10). Mostly cast CHAR CONSTANT * as CHAR *.
     29  17 JAN 10 GKY Changes to get working with Watcom 1.9 Beta (1/16/10).
     30                Mostly cast CHAR CONSTANT * as CHAR *.
     31  20 Nov 10 GKY Check that pTmpDir IsValid and recreate if not found; Fixes hangs caused
     32                by temp file creation failures.
    3033
    3134***********************************************************************/
     
    6366#include "fortify.h"
    6467#include "excputil.h"                   // xbeginthread
     68#include "valid.h"                      // IsValidDir
    6569
    6670// Data definitions
     
    267271
    268272  WinSendDlgItemMsg(hwnd, KILL_LISTBOX, LM_DELETEALL, MPVOID, MPVOID);
     273  if (pTmpDir && !IsValidDir(pTmpDir))
     274    DosCreateDir(pTmpDir, 0);
    269275  BldFullPathName(s, pTmpDir, "$PSTAT#$.#$#");
    270276  unlinkf(s);
  • trunk/dll/sysinfo.c

    r1544 r1554  
    1717  16 JUL 08 GKY Use TMP directory for temp files
    1818  08 Mar 09 GKY Removed variable aurguments from docopyf and unlinkf (not used)
     19  20 Nov 10 GKY Check that pTmpDir IsValid and recreate if not found; Fixes hangs caused
     20                by temp file creation failures.
    1921
    2022***********************************************************************/
     
    3941#include "misc.h"                       // PostMsg
    4042#include "strips.h"                     // bstrip
     43#include "valid.h"                      // IsValidDir
    4144
    4245#pragma data_seg(DATA1)
     
    6265    if (!WinIsWindow(thab, hwnd))
    6366      goto Abort;
     67    if (pTmpDir && !IsValidDir(pTmpDir))
     68      DosCreateDir(pTmpDir, 0);
    6469    BldFullPathName(szTempFile, pTmpDir, "$RMVIEW.#$#");
    6570    unlinkf(szTempFile);
  • trunk/dll/systemf.c

    r1544 r1554  
    3535  17 JAN 10 GKY Add ENVIRONMENT_SIZE vaiable to replace multiple (often different hard coded sizes) set to 2048
    3636                (the largest value I found).
     37  20 Nov 10 GKY Check that pTmpDir IsValid and recreate if not found; Fixes hangs caused
     38                by temp file creation failures.
    3739
    3840***********************************************************************/
     
    254256            CHAR *modew = "w";
    255257
     258            if (pTmpDir && !IsValidDir(pTmpDir))
     259              DosCreateDir(pTmpDir, 0);
    256260            strcpy(listfile, pTmpDir ? pTmpDir : pFM2SaveDirectory);
    257261            MakeTempName(listfile, "$FM2LI$T", 2);
  • trunk/dll/undel.c

    r1544 r1554  
    2020  08 Mar 09 GKY Additional strings move to PCSZs
    2121  28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code.
     22  20 Nov 10 GKY Check that pTmpDir IsValid and recreate if not found; Fixes hangs caused
     23                by temp file creation failures.
    2224
    2325***********************************************************************/
     
    9294    IncrThreadUsage();
    9395    WinSendDlgItemMsg(hwnd, UNDEL_LISTBOX, LM_DELETEALL, MPVOID, MPVOID);
     96    if (pTmpDir && !IsValidDir(pTmpDir))
     97      DosCreateDir(pTmpDir, 0);
    9498    BldFullPathName(szTempFile, pTmpDir, "$UDELETE.#$#");
    9599    unlinkf(szTempFile);
  • trunk/dll/worker.c

    r1544 r1554  
    4444  26 Jul 09 GKY Fix failure of containers to update when Tree container isn't open in FM2 lite
    4545  13 Dec 09 GKY Attempt to fix container update issues with FM/2 lite
    46   17 JAN 10 GKY Changes to get working with Watcom 1.9 Beta (1/16/10). Mostly cast CHAR CONSTANT * as CHAR *.
     46  17 JAN 10 GKY Changes to get working with Watcom 1.9 Beta (1/16/10).
     47                Mostly cast CHAR CONSTANT * as CHAR *.
     48  20 Nov 10 GKY Check that pTmpDir IsValid and recreate if not found; Fixes hangs caused
     49                by temp file creation failures.
    4750
    4851***********************************************************************/
     
    11711174                CHAR *modew = "w";
    11721175
    1173                 BldFullPathName(szTempFile, pTmpDir, PCSZ_FM2PLAYTEMP);
     1176                if (pTmpDir && !IsValidDir(pTmpDir))
     1177                  DosCreateDir(pTmpDir, 0);
     1178                BldFullPathName(szTempFile, pTmpDir, PCSZ_FM2PLAYTEMP);
    11741179                fp = xfopen(szTempFile, modew, pszSrcFile, __LINE__, FALSE);
    11751180                if (fp) {
Note: See TracChangeset for help on using the changeset viewer.