# include "splintMacros.nf"
# include "basic.h"
# include "osd.h"
-# include "portab.h"
/* from stat.h */
/*@ignore@*/
*fullPath == '\0' ||
(*file == CONNECTCHAR || (file[0] != '\0' && file[1] == ':'))
# else
- (*file == CONNECTCHAR)
+ (*file == CONNECTCHAR)
# endif
)
{
/* 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)
{
{
# 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);
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)
| (buf.st_mode & S_IXGRP) |
(buf.st_mode & S_IXOTH)
# endif
- ) != 0);
+ ) != 0); /* spurious */
# endif
}
}
# endif
- return (FALSE);
-
+ return (FALSE);
+ /*@=compdestroy@*/
}
/*
# endif
}
-# ifdef WIN32
+# if defined (WIN32) || defined (OS2) && defined (__IBMC__)
extern /*@external@*/ int _flushall (void) /*@modifies fileSystem@*/ ;
# endif
{
int res;
/* system ("printenv"); */
-# ifdef WIN32
+# if defined (WIN32) || defined (OS2) && defined (__IBMC__)
(void) _flushall ();
# endif
/*@=redecl@*/
# endif
-static s_tempError = FALSE;
+static bool s_tempError = FALSE;
void osd_setTempError (void)
{
# if defined (WIN32) || defined (OS2) && defined (__IBMC__)
int pid = _getpid ();
# else
- pid_t pid = getpid ();
+ __pid_t pid = getpid ();
# endif
return (int) pid;