From 027f22abd3069632963019951d23b0b1a6c1541e Mon Sep 17 00:00:00 2001 From: lifegpc Date: Fri, 31 Dec 2021 10:41:39 +0800 Subject: [PATCH] open p_mode now also supported on UNIX --- fileop.cpp | 2 +- fileop.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fileop.cpp b/fileop.cpp index 1a99a0f..995a9fa 100644 --- a/fileop.cpp +++ b/fileop.cpp @@ -232,7 +232,7 @@ int fileop::open(std::string fn, int& fd, int oflag, int shflag, int pmode) { fd = tmfd; return fd == -1 ? err : 0; #else - fd = ::open(fn.c_str(), oflag); + fd = ::open(fn.c_str(), oflag, pmode); return fd == -1 ? errno : 0; #endif } diff --git a/fileop.h b/fileop.h index 32ebf55..175dbf4 100644 --- a/fileop.h +++ b/fileop.h @@ -51,7 +51,7 @@ namespace fileop { * @param fd file descriptor. -1 if error occured. * @param oflag The kind of operations allowed. * @param shflag The kind of sharing allowed. (Windows Only) - * @param pmode Permission mode. (Windows Only) + * @param pmode Permission mode. * @return errno */ int open(std::string fn, int& fd, int oflag, int shflag = 0x10, int pmode = 0);