mirror of
https://github.com/openharmony/third_party_ltp.git
synced 2026-07-01 12:25:45 -04:00
修改sem信号传入na_max值为256
Signed-off-by: zWX1144765 <zhaominjie9@huawei.com>
This commit is contained in:
@@ -166,7 +166,7 @@ int main(void)
|
||||
|
||||
if (NAME_MAX > 0) {
|
||||
/* create a semaphore with a name longer than NAME_MAX */
|
||||
sem_name = calloc(NAME_MAX + 2, sizeof(char));
|
||||
sem_name = calloc(NAME_MAX + 3, sizeof(char));
|
||||
|
||||
if (sem_name == NULL) {
|
||||
UNRESOLVED(errno,
|
||||
@@ -176,9 +176,9 @@ int main(void)
|
||||
/* the space was allocated */
|
||||
sem_name[0] = '/';
|
||||
|
||||
sem_name[NAME_MAX + 1] = '\0';
|
||||
sem_name[NAME_MAX + 2] = '\0';
|
||||
|
||||
memset(sem_name + 1, 'N', NAME_MAX);
|
||||
memset(sem_name + 1, 'N', NAME_MAX + 1);
|
||||
|
||||
/* Create the semaphore */
|
||||
sem = sem_open(sem_name, O_CREAT, 0777, 1);
|
||||
|
||||
Reference in New Issue
Block a user