Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libc/src/unistd/linux/pipe2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"

#include "src/errno/libc_errno.h"

#include <sys/syscall.h> // For syscall numbers.

namespace LIBC_NAMESPACE {
Expand All @@ -26,7 +26,7 @@ LLVM_LIBC_FUNCTION(int, pipe2, (int pipefd[2], int flags)) {
#else
#error "pipe and pipe2 not available."
#endif
if (ret == -1) {
if (ret < 0) {
libc_errno = -ret;
return -1;
}
Expand Down
2 changes: 0 additions & 2 deletions libc/src/unistd/pipe2.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
#ifndef LLVM_LIBC_SRC_UNISTD_PIPE2_H
#define LLVM_LIBC_SRC_UNISTD_PIPE2_H

#include <unistd.h>

namespace LIBC_NAMESPACE {

int pipe2(int pipefd[2], int flags);
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/unistd/pipe2_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ TEST(LlvmLibcPipe2Test, ReadAndWriteViaPipe2) {
ASSERT_ERRNO_SUCCESS();
}

TEST(LlvmLibcPipe2Test, Pipe2InvalidFlags) {
TEST(LlvmLibcPipe2Test,Pipe2InvalidFlags) {
int invalidflags = O_CREAT | O_PATH | O_SYNC;
int pipefd[2];

Expand Down