nasa / osal

The Core Flight System (cFS) Operating System Abstraction Layer (OSAL)
Apache License 2.0
555 stars 217 forks source link

lgtm issues for os-impl-posix-files.c, osapi-filesys.c #333

Closed avan989 closed 4 years ago

avan989 commented 4 years ago

Is your feature request related to a problem? Please describe. os-impl-posix-files.c

line 240:

if ( chmod(local_path, st.st_mode) < 0 )
--
  | The filename being operated upon was previously checked, but the underlying file may have been changed since then.

osapi-filesys.c

line 330:
OS_FileSysStopVolume_Impl(local_id);
--
  | This expression has no effect (because OS_FileSysStopVolume_Impl has no external side effects).

Requester Info Anh Van, NASA Goddard

avan989 commented 4 years ago

Reference https://github.com/nasa/osal/pull/326:

os-impl-posix-files.c: possible solution use open() to get file descriptor with O_PATH flag but it is Linux-specific (non-posix).

osapi-filesys.c: On second look maybe the OS_FileSysStopVolume_Impl shouldn't be entirely empty here.

jphickey commented 3 years ago

FYI - turns out this PR broke our VxWorks build:

/home/jphickey/cfecfs/github/osal/src/os/portable/os-impl-posix-files.c: In function 'OS_FileChmod_Impl':
/home/jphickey/cfecfs/github/osal/src/os/portable/os-impl-posix-files.c:202: error: too few arguments to function 'open'
make[7]: *** [osal/vxworks_impl/CMakeFiles/osal_vxworks_impl.dir/__/portable/os-impl-posix-files.c.obj] Error 1
make[6]: *** [osal/vxworks_impl/CMakeFiles/osal_vxworks_impl.dir/all] Error 2