stdio.c (ca934ebcae352ce0aa740fd1a57518d571ee7849) stdio.c (6946977c36c9db3d6b7c2cbbd281b2cc878471e9)
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

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

113 if (errno == 0)
114 errno = serrno;
115 /*
116 * Disallow negative seeks per POSIX.
117 * It is needed here to help upper level caller
118 * (fseek) in the cases it can't detect.
119 */
120 if (ret < 0) {
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

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

113 if (errno == 0)
114 errno = serrno;
115 /*
116 * Disallow negative seeks per POSIX.
117 * It is needed here to help upper level caller
118 * (fseek) in the cases it can't detect.
119 */
120 if (ret < 0) {
121 if (errret == 0)
121 if (errret == 0) {
122 fp->_flags |= __SERR;
122 errno = EINVAL;
123 errno = EINVAL;
124 }
123 fp->_flags &= ~__SOFF;
124 ret = -1;
125 } else {
126 fp->_flags |= __SOFF;
127 fp->_offset = ret;
128 }
129 return (ret);
130}
131
132int
133__sclose(cookie)
134 void *cookie;
135{
136
137 return (_close(((FILE *)cookie)->_file));
138}
125 fp->_flags &= ~__SOFF;
126 ret = -1;
127 } else {
128 fp->_flags |= __SOFF;
129 fp->_offset = ret;
130 }
131 return (ret);
132}
133
134int
135__sclose(cookie)
136 void *cookie;
137{
138
139 return (_close(((FILE *)cookie)->_file));
140}