diff --git a/hurd/fchroot.c b/hurd/fchroot.c index b09c839371..7f176f730e 100644 --- a/hurd/fchroot.c +++ b/hurd/fchroot.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -17,10 +17,9 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include -#include -#include #include #include +#include /* Change the current directory root to FD. */ int @@ -29,13 +28,21 @@ DEFUN(fchroot, (fd), int fd) error_t err; file_t crdir; - /* XXX check that's it's a directory */ + err = HURD_DPORT_USE + (fd, + ({ struct stat st; + crdir = port; + err = __io_stat (crdir, &st); + if (! err && ! S_ISDIR (st.st_mode)) + err = ENOTDIR; + if (! err) + __mach_port_mod_refs (__mach_task_self (), + crdir, MACH_PORT_RIGHT_SEND, 1); + err; + })); - if (err = _HURD_DPORT_USE (fd, - __mach_port_mod_refs (__mach_task_self (), - (crdir = port), - MACH_PORT_RIGHT_SEND, 1))) - return err; + if (err) + return __hurd_fail (err); _hurd_port_set (&_hurd_ports[INIT_PORT_CRDIR], crdir); diff --git a/stdio/vfscanf.c b/stdio/vfscanf.c index a5e49934ad..0bc23ead0f 100644 --- a/stdio/vfscanf.c +++ b/stdio/vfscanf.c @@ -433,7 +433,6 @@ DEFUN(__vfscanf, (s, format, arg), } break; -#ifndef MIB_HACKS case 'e': /* Floating-point numbers. */ case 'E': case 'f': @@ -481,6 +480,7 @@ DEFUN(__vfscanf, (s, format, arg), if (w[-1] == '-' || w[-1] == '+' || w[-1] == 'e') conv_error(); +#ifndef MIB_HACKS /* Convert the number. */ *w = '\0'; fp_num = strtod(work, &w); @@ -498,7 +498,7 @@ DEFUN(__vfscanf, (s, format, arg), ++done; } break; -#endif MIB_HACKS +#endif /* MIB_HACKS */ case '[': /* Character class. */ STRING_ARG; diff --git a/sysdeps/mach/hurd/errlist.awk b/sysdeps/mach/hurd/errlist.awk index 4f37f0ffa3..1506b97c59 100644 --- a/sysdeps/mach/hurd/errlist.awk +++ b/sysdeps/mach/hurd/errlist.awk @@ -1,4 +1,4 @@ -# Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. +# Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -46,16 +46,18 @@ errnoh == 1 && $1 == "@comment" \ errnoh == 2 && $1 == "@deftypevr" && $2 == "Macro" && $3 == "int" \ { e = $4; - s = " \"" etext "\","; - l = 40 - length (s); - while (l-- > 0) - s = s " "; - printf "%s/* %d = %s */\n", s, ++errno, e; + if (e != "EAGAIN") + printf "%-40s/* %d = %s */\n", " \"" etext "\",", ++errno, e; next; } { errnoh=0 } END { print " };"; print ""; + print "#include "; + ++errno; + printf "#if _HURD_ERRNOS != %d\n", errno; + print "#error errlist/errnos generation bug"; + print "#endif" printf "const int _sys_nerr = %d;\n", errno; }