fwide.c (1e98f88776fc606df245a382685b1ac634a81389) fwide.c (e74101e4eff767325553039def89de70b70f36d3)
1/*-
2 * Copyright (c) 2002 Tim J. Robbins.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

37
38int
39fwide(FILE *fp, int mode)
40{
41 int m;
42
43 FLOCKFILE(fp);
44 /* Only change the orientation if the stream is not oriented yet. */
1/*-
2 * Copyright (c) 2002 Tim J. Robbins.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

37
38int
39fwide(FILE *fp, int mode)
40{
41 int m;
42
43 FLOCKFILE(fp);
44 /* Only change the orientation if the stream is not oriented yet. */
45 if (mode != 0 && fp->_orientation == 0)
46 fp->_orientation = mode > 0 ? 1 : -1;
47 m = fp->_orientation;
45 if (mode != 0 && fp->_extra->orientation == 0)
46 fp->_extra->orientation = mode > 0 ? 1 : -1;
47 m = fp->_extra->orientation;
48 FUNLOCKFILE(fp);
49
50 return (m);
51}
48 FUNLOCKFILE(fp);
49
50 return (m);
51}