diff options
author | Roland McGrath <roland@gnu.org> | 1996-04-25 18:13:38 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1996-04-25 18:13:38 +0000 |
commit | 7f77e07b004bacb367119c8aa7f260ffa0cb57d7 (patch) | |
tree | 3bdb4260f2d204299d4002d1fce75bb3e1897dbe /stdio/internals.c | |
parent | 66aeca9cfbd8cf37f47f15fcbde937cf4f5382f8 (diff) | |
download | glibc-7f77e07b004bacb367119c8aa7f260ffa0cb57d7.zip glibc-7f77e07b004bacb367119c8aa7f260ffa0cb57d7.tar.gz glibc-7f77e07b004bacb367119c8aa7f260ffa0cb57d7.tar.bz2 |
Wed Apr 24 00:22:42 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* stdio/internals.c (seek_to_target): Set errno if seek function
returns the wrong offset.
Diffstat (limited to 'stdio/internals.c')
-rw-r--r-- | stdio/internals.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/stdio/internals.c b/stdio/internals.c index acdf977..a1d1fa4 100644 --- a/stdio/internals.c +++ b/stdio/internals.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 92, 93, 94, 95, 96 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 @@ -169,8 +169,19 @@ DEFUN(seek_to_target, (fp), FILE *fp) { fp->__offset = pos; if (pos != fp->__target) - /* Seek didn't go to the right place! */ - fp->__error = 1; + { + /* Seek didn't go to the right place! + This should never happen. */ +#ifdef EGRATUITOUS + /* It happens in the Hurd when the io server doesn't + obey the protocol for io_seek. */ + errno = EGRATUITOUS; +#else + /* I don't think this can happen in Unix. */ + errno = ESPIPE; /* ??? */ +#endif + fp->__error = 1; + } } } } |