]> andersk Git - splint.git/blobdiff - src/fileTable.c
Fixed localtime/gmtime null anntation.
[splint.git] / src / fileTable.c
index f570e12e48e5baf4dd4ea6a2746dff88ce4b39b5..0b23d1b7365f6d9534349539dfe61c951e87ceb3 100644 (file)
@@ -1,6 +1,6 @@
 /*
 ** Splint - annotation-assisted static program checker
-** Copyright (C) 1994-2002 University of Virginia,
+** Copyright (C) 1994-2003 University of Virginia,
 **         Massachusetts Institute of Technology
 **
 ** This program is free software; you can redistribute it and/or modify it
 # include <sys/stat.h>
 # include <fcntl.h>
 # include "splintMacros.nf"
-# include "llbasic.h"
+# include "basic.h"
 # include "osd.h"
 # include "llmain.h"
-# include "portab.h"
 
+# ifdef WIN32
+# include <io.h>
+# else
 # if defined(__IBMC__) && defined(OS2)
 # include <process.h>
 # include <io.h>
@@ -61,6 +63,7 @@
 # define S_IWUSR S_IWRITE 
 # define S_IXUSR S_IEXEC
 # endif
+# endif
 
 /*@access fileId*/
 
@@ -328,7 +331,6 @@ fileTable_addFilePrim (fileTable ft, /*@temp@*/ cstring name,
   cstring absname = osd_absolutePath (NULL, name);
   int tindex = fileTable_getIndex (ft, absname);
   
-  /*@i534 fprintf (stderr, "Got abs path: %s", absname); */
   llassert (ft != fileTable_undefined);
 
   if (tindex != NOT_FOUND)
@@ -829,7 +831,7 @@ fileTable_cleanup (fileTable ft)
            }
          else if (fileId_isValid (fe->fder)) 
            {
-             /*@i423 this should use close (fd) also... */
+             /* this should use close (fd) also... */
              (void) osd_unlink (fe->fname);
            }
          else if (fe->ftype == FILE_MACROS)
@@ -1012,10 +1014,14 @@ fileTable_addOpen (fileTable ft, /*@observer@*/ FILE *f, /*@only@*/ cstring fnam
 
 FILE *fileTable_createFile (fileTable ft, cstring fname)
 {
-# ifdef WIN32
-   int fdesc = open (cstring_toCharsSafe (fname), O_WRONLY | O_CREAT | O_TRUNC | O_EXCL); /* not supported by VS.net: , S_IRUSR | S_IWUSR); */
+# if defined (WIN32) && !defined (BCC32)
+  int fdesc = _open (cstring_toCharsSafe (fname), 
+                    O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 
+                    _S_IWRITE | S_IREAD);
 # else
-   int fdesc = open (cstring_toCharsSafe (fname), O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, S_IRUSR | S_IWUSR);
+   int fdesc = open (cstring_toCharsSafe (fname), 
+                    O_WRONLY | O_CREAT | O_TRUNC | O_EXCL,
+                    S_IRUSR | S_IWUSR);
 # endif
 
   if (fdesc == -1)
@@ -1048,7 +1054,15 @@ FILE *fileTable_createFile (fileTable ft, cstring fname)
 
 FILE *fileTable_createMacrosFile (fileTable ft, cstring fname)
 {
-  int fdesc = open (cstring_toCharsSafe (fname), O_RDWR | O_CREAT | O_TRUNC | O_EXCL, S_IRUSR | S_IWUSR);
+# if defined (WIN32) && !defined (BCC32)
+  int fdesc = _open (cstring_toCharsSafe (fname), 
+                    O_RDWR | O_CREAT | O_TRUNC | O_EXCL,
+                    _S_IREAD | _S_IWRITE);
+# else
+  int fdesc = open (cstring_toCharsSafe (fname), 
+                   O_RDWR | O_CREAT | O_TRUNC | O_EXCL, 
+                   S_IRUSR | S_IWUSR);
+# endif
 
   if (fdesc == -1)
     {
This page took 0.415868 seconds and 4 git commands to generate.