Skip to content

Commit a8fcbfd

Browse files
committed
address comments
1 parent 069e615 commit a8fcbfd

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

libc/src/sys/mman/linux/process_mrelease.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ LLVM_LIBC_FUNCTION(int, process_mrelease, (int pidfd, unsigned int flags)) {
2424

2525
if (ret < 0) {
2626
libc_errno = static_cast<int>(-ret);
27-
return libc_errno;
27+
return -1;
2828
}
2929

3030
return 0;

libc/src/sys/mman/process_mrelease.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
//===-- Implementation header for process_mrelease function -----------------*-
2-
// C++ -*-===//
1+
//===-- Implementation header for process_mrelease function --------*- C++ -*-===//
32
//
43
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
54
// See https://llvm.org/LICENSE.txt for license information.
65
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
76
//
8-
//===----------------------------------------------------------------------===//
7+
//===-------------------------------------------------------------------------===//
98

109
#ifndef LLVM_LIBC_SRC_SYS_MMAN_PROCESS_MRELEASE_H
1110
#define LLVM_LIBC_SRC_SYS_MMAN_PROCESS_MRELEASE_H

libc/test/src/sys/mman/linux/process_mrelease_test.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
//===-- Unittests for process_mrelease ------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
18
//===-- Unittests for process_mrelease
29
//-------------------------------------===//
310
//
@@ -68,5 +75,5 @@ TEST(LlvmLibcMProcessMReleaseTest, ErrorNotKilled) {
6875

6976
TEST(LlvmLibcMProcessMReleaseTest, ErrorNonExistingPidfd) {
7077

71-
ASSERT_EQ(LIBC_NAMESPACE::process_mrelease(12345, 0), EBADF);
78+
ASSERT_EQ(LIBC_NAMESPACE::process_mrelease(-1, 0), EBADF);
7279
}

0 commit comments

Comments
 (0)