View | Details | Raw Unified | Return to bug 199806
Collapse All | Expand All

(-)lib/libc/stdio/flags.c (+9 lines)
Lines 52-57 Link Here
52
__sflags(const char *mode, int *optr)
52
__sflags(const char *mode, int *optr)
53
{
53
{
54
	int ret, m, o, known;
54
	int ret, m, o, known;
55
	int do_locks = 0;
55
56
56
	switch (*mode++) {
57
	switch (*mode++) {
57
58
Lines 97-102 Link Here
97
			/* set close-on-exec */
98
			/* set close-on-exec */
98
			o |= O_CLOEXEC;
99
			o |= O_CLOEXEC;
99
			break;
100
			break;
101
		case 'l':
102
			/* shared or exclusive locking */
103
			do_locks = 1;
104
			break;
100
		case 'v':
105
		case 'v':
101
			/* verify */
106
			/* verify */
102
			o |= O_VERIFY;
107
			o |= O_VERIFY;
Lines 112-117 Link Here
112
		return (0);
117
		return (0);
113
	}
118
	}
114
119
120
	if (do_locks != 0) {
121
		o |= (m == O_RDONLY) ? O_SHLOCK : O_EXLOCK;
122
	}
123
115
	*optr = m | o;
124
	*optr = m | o;
116
	return (ret);
125
	return (ret);
117
}
126
}

Return to bug 199806