-/* Copyright (C) 1991, 92, 96, 98, 99, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,96,98,99,2000,2005,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
#include <stdio.h>
#include <grp.h>
-#ifdef USE_IN_LIBIO
-# define flockfile(s) _IO_flockfile (s)
-# define funlockfile(s) _IO_funlockfile (s)
-#endif
+#define flockfile(s) _IO_flockfile (s)
+#define funlockfile(s) _IO_funlockfile (s)
#define _S(x) x ? x : ""
flockfile (stream);
- retval = fprintf (stream, "%s:%s:%u:",
- gr->gr_name, _S (gr->gr_passwd), gr->gr_gid);
+ if (gr->gr_name[0] == '+' || gr->gr_name[0] == '-')
+ retval = fprintf (stream, "%s:%s::",
+ gr->gr_name, _S (gr->gr_passwd));
+ else
+ retval = fprintf (stream, "%s:%s:%lu:",
+ gr->gr_name, _S (gr->gr_passwd),
+ (unsigned long int) gr->gr_gid);
if (__builtin_expect (retval, 0) < 0)
{
funlockfile (stream);