VirtualBox

Changeset 94277 in vbox


Ignore:
Timestamp:
Mar 17, 2022 1:32:55 AM (3 years ago)
Author:
vboxsync
Message:

IPRT/RTFileFlush: Shut up annoying VERR_INVALID_PARAMETER returns on posix systems when trying to flush a tty.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/file.h

    r93115 r94277  
    542542 *
    543543 * @returns iprt status code.
     544 * @retval  VINF_NOT_SUPPORTED if it is a special file that does not support
     545 *          flushing.  This is reported as a informational status since in most
     546 *          cases this is entirely harmless (e.g. tty) and simplifies the usage.
    544547 * @param   File        Handle to the file.
    545548 */
  • trunk/src/VBox/Runtime/r3/posix/fileio-posix.cpp

    r93115 r94277  
    833833
    834834
    835 RTR3DECL(int)  RTFileFlush(RTFILE hFile)
    836 {
    837     if (fsync(RTFileToNative(hFile)))
    838         return RTErrConvertFromErrno(errno);
    839     return VINF_SUCCESS;
     835RTR3DECL(int) RTFileFlush(RTFILE hFile)
     836{
     837    if (!fsync(RTFileToNative(hFile)))
     838        return VINF_SUCCESS;
     839    /* Ignore EINVAL here as that's what returned for pseudo ttys
     840       and other odd handles. */
     841    if (errno == EINVAL)
     842        return VINF_NOT_SUPPORTED;
     843    return RTErrConvertFromErrno(errno);
    840844}
    841845
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette