#include <string.h>
#include <sys/types.h>
+#ifdef USE_IN_LIBIO
+# define flockfile(s) _IO_flockfile (s)
+# define funlockfile(s) _IO_funlockfile (s)
+#endif
+
/* Prepare to begin reading and/or writing mount table entries from the
beginning of FILE. MODE is as for `fopen'. */
FILE *
char *end_ptr;
if (fgets_unlocked (buffer, bufsiz, stream) == NULL)
- return NULL;
+ {
+ funlockfile (stream);
+ return NULL;
+ }
end_ptr = strchr (buffer, '\n');
if (end_ptr != NULL) /* chop newline */
while ((p = strstr (rest, opt)) != NULL)
{
- if (p == rest || p[-1] == ',' &&
- (p[optlen] == '\0' ||
- p[optlen] == '=' ||
- p[optlen] == ','))
+ if (p == rest
+ || (p[-1] == ','
+ && (p[optlen] == '\0' ||
+ p[optlen] == '=' ||
+ p[optlen] == ',')))
return p;
rest = strchr (rest, ',');