Changeset 683 for trunk/kernel/syscalls/sys_pipe.c
- Timestamp:
- Jan 13, 2021, 12:36:17 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_pipe.c
r670 r683 36 36 { 37 37 vseg_t * vseg; 38 kmem_req_t req;39 38 pipe_t * pipe; 40 39 vfs_file_t * file_0; … … 88 87 // 2. allocate memory for fd[0] file descriptor in local cluster 89 88 // we don't use the vfs_file_create function because there is no inode. 90 req.type = KMEM_KCM; 91 req.order = bits_log2( sizeof(vfs_file_t) ); 92 req.flags = AF_ZERO; 93 file_0 = kmem_alloc( &req ); 89 file_0 = kmem_alloc( bits_log2(sizeof(vfs_file_t)) , AF_ZERO ); 94 90 95 91 if( file_0 == NULL ) … … 120 116 121 117 // 4. allocate memory for fd[1] file descriptor in local cluster 122 req.type = KMEM_KCM; 123 req.order = bits_log2( sizeof(vfs_file_t) ); 124 req.flags = AF_ZERO; 125 file_1 = kmem_alloc( &req ); 118 // we don't use the vfs_file_create function because there is no inode. 119 file_1 = kmem_alloc( bits_log2(sizeof(vfs_file_t)) , AF_ZERO ); 126 120 127 121 if( file_1 == NULL ) … … 178 172 error_5: // release memory allocated for fd[1] file descriptor 179 173 180 req.ptr = file_1; 181 kmem_free( &req ); 174 kmem_free( file_1 , bits_log2(sizeof(vfs_file_t)) ); 182 175 183 176 error_4: // release fdid_0 from fd_array[] … … 187 180 error_3: // release memory allocated for fd[0] file descriptor 188 181 189 req.ptr = file_0; 190 kmem_free( &req ); 182 kmem_free( file_0 , bits_log2(sizeof(vfs_file_t)) ); 191 183 192 184 error_2: // release memory allocated for the pipe
Note: See TracChangeset
for help on using the changeset viewer.