From 8f90e48da309c9e62b828c299dd813edfc817f96 Mon Sep 17 00:00:00 2001
From: Guo Wenxue <guowenxue@gmail.com>
Date: Wed, 24 Oct 2018 16:05:47 +0800
Subject: [PATCH] Update APUE ch1_fileIO source code, fix loss head file result to compile warinning on RPI bug
---
ch1_fileIO/redirect_stdio.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/ch1_fileIO/redirect_stdio.c b/ch1_fileIO/redirect_stdio.c
index 52270f0..a73f1ea 100644
--- a/ch1_fileIO/redirect_stdio.c
+++ b/ch1_fileIO/redirect_stdio.c
@@ -14,7 +14,7 @@
if(fd < 0)
{
printf("Open file failure: %s\n", strerror(errno));
- return ;
+ return 1;
}
dup2(fd, STDIN_FILENO);
@@ -24,5 +24,7 @@
printf("fd=%d\n", fd);
close(fd);
+
+ return 0;
}
--
Gitblit v1.9.1