]> andersk Git - splint.git/blobdiff - src/osd.c
*** empty log message ***
[splint.git] / src / osd.c
index 4e72f78ec4ce3862da158797e7aa77fd009558be..ebe214a9ac2ec7a4e56f42d86530f344e13f5aa3 100644 (file)
--- a/src/osd.c
+++ b/src/osd.c
@@ -62,7 +62,6 @@
 # include "splintMacros.nf"
 # include "basic.h"
 # include "osd.h"
-# include "portab.h"
 
 /* from stat.h */
 /*@ignore@*/
@@ -184,7 +183,7 @@ osd_getPath (cstring path, cstring file, cstring *returnPath)
       *fullPath == '\0' || 
       (*file == CONNECTCHAR || (file[0] != '\0' && file[1] == ':'))
 # else
-    (*file == CONNECTCHAR)
+      (*file == CONNECTCHAR)
 # endif
       )
     {
@@ -204,8 +203,8 @@ osd_getPath (cstring path, cstring file, cstring *returnPath)
       /* Path specified. Loop through directories in path looking for the */
       /* first occurrence of the file.                             */
       
-      while (nextdir (&fullPath, &dirPtr, &dirLen) &&
-            rVal == OSD_FILENOTFOUND)
+      while (nextdir (&fullPath, &dirPtr, &dirLen) 
+            && rVal == OSD_FILENOTFOUND)
        {
          if ((dirLen + strlen (file) + 2) <= MAXPATHLEN)
            {
@@ -302,7 +301,7 @@ osd_fileExists (cstring filespec)
 {
 # ifdef UNIX
   struct stat buf;
-  return (stat (cstring_toCharsSafe (filespec), &buf) == 0);
+  /*@i3@*/ return (stat (cstring_toCharsSafe (filespec), &buf) == 0); /* spurious */
 # else
 # if defined (WIN32) || defined (OS2)
   FILE *test = fileTable_openReadFile (context_fileTable (), filespec);
@@ -339,13 +338,15 @@ osd_fileExists (cstring filespec)
 bool
 osd_executableFileExists (/*@unused@*/ char *filespec)
 {
+  /*@-compdestroy@*/ /* possible memory leaks here? */
 # ifdef UNIX
   struct stat buf;
   if (stat (filespec, &buf) == 0)
     { 
       /* mask by file type */
-      /*@-unrecog@*/ /* S_IFMT is not defined */
-      if ((buf.st_mode & S_IFMT) != S_IFDIR /*@=unrecog@*/) /* not a directory */
+      /*@-type@*/ /* confusion about __mode_t and mode_t types */
+      if ((buf.st_mode & S_IFMT) != S_IFDIR) /* not a directory */ 
+       /*@=type@*/
        {
          /* as long as it is an executable file */
 # if defined(__IBMC__) && defined(OS2)
@@ -360,13 +361,13 @@ osd_executableFileExists (/*@unused@*/ char *filespec)
                   | (buf.st_mode & S_IXGRP) |
                   (buf.st_mode & S_IXOTH)
 # endif
-                  ) != 0);
+                  ) != 0); /* spurious */
 # endif
        }
     }
 # endif
-  return (FALSE);
-
+  return (FALSE); 
+  /*@=compdestroy@*/
 }
 
 /*
@@ -453,7 +454,7 @@ nextdir (d_char *current_dir, d_char *dir, size_t *len)
 # endif
 }
 
-# ifdef WIN32
+# if defined (WIN32) || defined (OS2) && defined (__IBMC__)
 extern /*@external@*/ int _flushall (void) /*@modifies fileSystem@*/ ;
 # endif
 
@@ -464,7 +465,7 @@ int osd_system (cstring cmd)
 {
   int res;
     /* system ("printenv"); */
-# ifdef WIN32
+# if defined (WIN32) || defined (OS2) && defined (__IBMC__)
   (void) _flushall (); 
 # endif
 
@@ -479,7 +480,7 @@ extern /*@external@*/ int unlink (const char *) /*@modifies fileSystem@*/ ;
 /*@=redecl@*/
 # endif
 
-static s_tempError = FALSE;
+static bool s_tempError = FALSE;
 
 void osd_setTempError (void)
 {
@@ -515,7 +516,7 @@ osd_getPid ()
 # if defined (WIN32) || defined (OS2) && defined (__IBMC__)
   int pid = _getpid ();
 # else
-  pid_t pid = getpid ();
+  __pid_t pid = getpid ();
 # endif
 
   return (int) pid;
This page took 0.080718 seconds and 4 git commands to generate.