Deleted Added
full compact
fopen.c (82654) fopen.c (82807)
1/*-
2 * Copyright (c) 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Chris Torek.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 19 unchanged lines hidden (view full) ---

28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
1/*-
2 * Copyright (c) 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Chris Torek.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 19 unchanged lines hidden (view full) ---

28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * $FreeBSD: head/lib/libc/stdio/fopen.c 82654 2001-08-31 13:14:49Z ache $
36 * $FreeBSD: head/lib/libc/stdio/fopen.c 82807 2001-09-02 19:10:10Z ache $
37 */
38
39#if defined(LIBC_SCCS) && !defined(lint)
40static char sccsid[] = "@(#)fopen.c 8.1 (Berkeley) 6/4/93";
41#endif /* LIBC_SCCS and not lint */
42
43#include "namespace.h"
44#include <sys/types.h>

--- 35 unchanged lines hidden (view full) ---

80 * When opening in append mode, even though we use O_APPEND,
81 * we need to seek to the end so that ftell() gets the right
82 * answer. If the user then alters the seek pointer, or
83 * the file extends, this will fail, but there is not much
84 * we can do about this. (We could set __SAPP and check in
85 * fseek and ftell.)
86 */
87 if (oflags & O_APPEND)
37 */
38
39#if defined(LIBC_SCCS) && !defined(lint)
40static char sccsid[] = "@(#)fopen.c 8.1 (Berkeley) 6/4/93";
41#endif /* LIBC_SCCS and not lint */
42
43#include "namespace.h"
44#include <sys/types.h>

--- 35 unchanged lines hidden (view full) ---

80 * When opening in append mode, even though we use O_APPEND,
81 * we need to seek to the end so that ftell() gets the right
82 * answer. If the user then alters the seek pointer, or
83 * the file extends, this will fail, but there is not much
84 * we can do about this. (We could set __SAPP and check in
85 * fseek and ftell.)
86 */
87 if (oflags & O_APPEND)
88 (void) __sseek((void *)fp, (fpos_t)0, SEEK_END);
88 (void)_sseek(fp, (fpos_t)0, SEEK_END);
89 return (fp);
90}
89 return (fp);
90}