Merge pull request #4531 from whj4674672/pipe

pipe name depend on RT_NAME_MAX
This commit is contained in:
Bernard Xiong 2021-03-27 14:51:15 +08:00 committed by GitHub
commit 9cf0720b68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -531,8 +531,8 @@ int rt_pipe_delete(const char *name)
int pipe(int fildes[2]) int pipe(int fildes[2])
{ {
rt_pipe_t *pipe; rt_pipe_t *pipe;
char dname[8]; char dname[RT_NAME_MAX];
char dev_name[32]; char dev_name[RT_NAME_MAX * 4];
static int pipeno = 0; static int pipeno = 0;
rt_snprintf(dname, sizeof(dname), "pipe%d", pipeno++); rt_snprintf(dname, sizeof(dname), "pipe%d", pipeno++);