posix: options: shm: use truncation flag that has been added
Originally, when the POSIX_SHARED_MEMORY_OBJECTS option was added, the O_TRUNC flag was not consistently available. Now that it is consistently available, ensure it is used within the shm_open() function. Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
This commit is contained in:
parent
d770a4c584
commit
dba7598517
1 changed files with 1 additions and 1 deletions
|
|
@ -305,7 +305,7 @@ int shm_open(const char *name, int oflag, mode_t mode)
|
||||||
bool rw = (oflag & O_RDWR) != 0;
|
bool rw = (oflag & O_RDWR) != 0;
|
||||||
bool creat = (oflag & O_CREAT) != 0;
|
bool creat = (oflag & O_CREAT) != 0;
|
||||||
bool excl = (oflag & O_EXCL) != 0;
|
bool excl = (oflag & O_EXCL) != 0;
|
||||||
bool trunc = false; /* (oflag & O_TRUNC) != 0 */
|
bool trunc = (oflag & O_TRUNC) != 0;
|
||||||
size_t name_len = (name == NULL) ? 0 : strnlen(name, PATH_MAX);
|
size_t name_len = (name == NULL) ? 0 : strnlen(name, PATH_MAX);
|
||||||
|
|
||||||
/* revisit when file-based permissions are available */
|
/* revisit when file-based permissions are available */
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue