aboutsummaryrefslogtreecommitdiffstats
path: root/input.c
diff options
context:
space:
mode:
authorJari Aalto <jari.aalto@cante.net>2004-07-27 13:29:18 +0000
committerJari Aalto <jari.aalto@cante.net>2009-09-12 16:46:56 +0000
commitb80f6443b6b7b620c7272664c66ecb0b120a0998 (patch)
tree9f71c98d8fe8fa0f41d95e1eb4227f32a09d43ca /input.c
parent7117c2d221b2aed4ede8600f6a36b7c1454b4f55 (diff)
downloadandroid_external_bash-b80f6443b6b7b620c7272664c66ecb0b120a0998.tar.gz
android_external_bash-b80f6443b6b7b620c7272664c66ecb0b120a0998.tar.bz2
android_external_bash-b80f6443b6b7b620c7272664c66ecb0b120a0998.zip
Imported from ../bash-3.0.tar.gz.
Diffstat (limited to 'input.c')
-rw-r--r--input.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/input.c b/input.c
index 9cb5401..c4f335d 100644
--- a/input.c
+++ b/input.c
@@ -21,7 +21,7 @@
#include "config.h"
#include "bashtypes.h"
-#ifndef _MINIX
+#if !defined (_MINIX) && defined (HAVE_SYS_FILE_H)
# include <sys/file.h>
#endif
#include "filecntl.h"
@@ -34,6 +34,8 @@
#endif
#include "bashansi.h"
+#include "bashintl.h"
+
#include "command.h"
#include "general.h"
#include "input.h"
@@ -226,7 +228,7 @@ save_bash_input (fd, new_fd)
if (nfd == -1)
{
if (fcntl (fd, F_GETFD, 0) == 0)
- sys_error ("cannot allocate new file descriptor for bash input from fd %d", fd);
+ sys_error (_("cannot allocate new file descriptor for bash input from fd %d"), fd);
return -1;
}
@@ -234,7 +236,7 @@ save_bash_input (fd, new_fd)
{
/* What's this? A stray buffer without an associated open file
descriptor? Free up the buffer and report the error. */
- internal_error ("check_bash_input: buffer already exists for new fd %d", nfd);
+ internal_error (_("save_bash_input: buffer already exists for new fd %d"), nfd);
free_buffered_stream (buffers[nfd]);
}
@@ -276,8 +278,13 @@ int
check_bash_input (fd)
int fd;
{
- if (fd > 0 && fd_is_bash_input (fd))
- return ((save_bash_input (fd, -1) == -1) ? -1 : 0);
+ if (fd_is_bash_input (fd))
+ {
+ if (fd > 0)
+ return ((save_bash_input (fd, -1) == -1) ? -1 : 0);
+ else if (fd == 0)
+ return ((sync_buffered_stream (fd) == -1) ? -1 : 0);
+ }
return 0;
}