summaryrefslogtreecommitdiff
path: root/Python/dup2.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-11-28 17:56:10 +0200
committerGitHub <noreply@github.com>2017-11-28 17:56:10 +0200
commit598ceae876ff4a23072e59945597e945583de4ab (patch)
treea7c0c1380c40bda01c70b8bd40ba47d1b2f6d54a /Python/dup2.c
parent08d2b86a1058b733bb7f1ae2b55818dd9687d21c (diff)
downloadcpython-git-598ceae876ff4a23072e59945597e945583de4ab.tar.gz
bpo-32150: Expand tabs to spaces in C files. (#4583)
Diffstat (limited to 'Python/dup2.c')
-rw-r--r--Python/dup2.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/Python/dup2.c b/Python/dup2.c
index 2579afd443..7c6bbfce11 100644
--- a/Python/dup2.c
+++ b/Python/dup2.c
@@ -19,13 +19,13 @@
int
dup2(int fd1, int fd2)
{
- if (fd1 != fd2) {
- if (fcntl(fd1, F_GETFL) < 0)
- return BADEXIT;
- if (fcntl(fd2, F_GETFL) >= 0)
- close(fd2);
- if (fcntl(fd1, F_DUPFD, fd2) < 0)
- return BADEXIT;
- }
- return fd2;
+ if (fd1 != fd2) {
+ if (fcntl(fd1, F_GETFL) < 0)
+ return BADEXIT;
+ if (fcntl(fd2, F_GETFL) >= 0)
+ close(fd2);
+ if (fcntl(fd1, F_DUPFD, fd2) < 0)
+ return BADEXIT;
+ }
+ return fd2;
}