Clarify ANSI, not POSIX, terminal escapes in ChangeLog
[deliverable/binutils-gdb.git] / readline / shell.c
index ad27cc14884b8fbb09404705fff9761a53366ab8..35b1c1d6ea96835f758f9035fa9495bb8a8f75d0 100644 (file)
@@ -27,6 +27,7 @@
 #endif
 
 #include <sys/types.h>
+#include <stdio.h>
 
 #if defined (HAVE_UNISTD_H)
 #  include <unistd.h>
@@ -49,7 +50,9 @@
 #endif
 
 #include <fcntl.h>
+#ifdef HAVE_PWD_H
 #include <pwd.h>
+#endif
 
 #include <stdio.h>
 
@@ -155,9 +158,11 @@ sh_get_home_dir ()
   struct passwd *entry;
 
   home_dir = (char *)NULL;
+#ifdef HAVE_GETPWUID
   entry = getpwuid (getuid ());
   if (entry)
     home_dir = entry->pw_dir;
+#endif
   return (home_dir);
 }
 
@@ -171,6 +176,7 @@ int
 sh_unset_nodelay_mode (fd)
      int fd;
 {
+#ifdef HAVE_FNCTL
   int flags, bflags;
 
   if ((flags = fcntl (fd, F_GETFL, 0)) < 0)
@@ -191,6 +197,7 @@ sh_unset_nodelay_mode (fd)
       flags &= ~bflags;
       return (fcntl (fd, F_SETFL, flags));
     }
+#endif
 
   return 0;
 }
This page took 0.02312 seconds and 4 git commands to generate.