aboutsummaryrefslogtreecommitdiff
path: root/pwd/putpwent.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
committerUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
commita334319f6530564d22e775935d9c91663623a1b4 (patch)
treeb5877475619e4c938e98757d518bb1e9cbead751 /pwd/putpwent.c
parent0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (diff)
downloadglibc-a334319f6530564d22e775935d9c91663623a1b4.tar
glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.gz
glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.bz2
glibc-a334319f6530564d22e775935d9c91663623a1b4.zip
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
Diffstat (limited to 'pwd/putpwent.c')
-rw-r--r--pwd/putpwent.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/pwd/putpwent.c b/pwd/putpwent.c
index a1041ec1c2..8b7767bd4a 100644
--- a/pwd/putpwent.c
+++ b/pwd/putpwent.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1992,1996,1997,1998,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1996, 1997, 1998 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
@@ -20,7 +20,7 @@
#include <stdio.h>
#include <pwd.h>
-#define _S(x) x ?: ""
+#define _S(x) x ? x : ""
/* Write an entry to the given stream.
This must know the format of the password file. */
@@ -35,21 +35,11 @@ putpwent (p, stream)
return -1;
}
- if (p->pw_name[0] == '+' || p->pw_name[0] == '-')
- {
- if (fprintf (stream, "%s:%s:::%s:%s:%s\n",
- p->pw_name, _S (p->pw_passwd),
- _S (p->pw_gecos), _S (p->pw_dir), _S (p->pw_shell)) < 0)
- return -1;
- }
- else
- {
- if (fprintf (stream, "%s:%s:%lu:%lu:%s:%s:%s\n",
- p->pw_name, _S (p->pw_passwd),
- (unsigned long int) p->pw_uid,
- (unsigned long int) p->pw_gid,
- _S (p->pw_gecos), _S (p->pw_dir), _S (p->pw_shell)) < 0)
- return -1;
- }
+ if (fprintf (stream, "%s:%s:%lu:%lu:%s:%s:%s\n",
+ p->pw_name, _S (p->pw_passwd),
+ (unsigned long int) p->pw_uid, (unsigned long int) p->pw_gid,
+ _S (p->pw_gecos), _S (p->pw_dir), _S (p->pw_shell)) < 0)
+ return -1;
+
return 0;
}