usr/src/lib/libc/port/gen/putspent.c
changeset 6812 febeba71273d
parent 0 68f95e015346
equal deleted inserted replaced
6811:2ed8737b86b7 6812:febeba71273d
     1 /*
     1 /*
     2  * CDDL HEADER START
     2  * CDDL HEADER START
     3  *
     3  *
     4  * The contents of this file are subject to the terms of the
     4  * The contents of this file are subject to the terms of the
     5  * Common Development and Distribution License, Version 1.0 only
     5  * Common Development and Distribution License (the "License").
     6  * (the "License").  You may not use this file except in compliance
     6  * You may not use this file except in compliance with the License.
     7  * with the License.
       
     8  *
     7  *
     9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
     8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
    10  * or http://www.opensolaris.org/os/licensing.
     9  * or http://www.opensolaris.org/os/licensing.
    11  * See the License for the specific language governing permissions
    10  * See the License for the specific language governing permissions
    12  * and limitations under the License.
    11  * and limitations under the License.
    17  * fields enclosed by brackets "[]" replaced with your own identifying
    16  * fields enclosed by brackets "[]" replaced with your own identifying
    18  * information: Portions Copyright [yyyy] [name of copyright owner]
    17  * information: Portions Copyright [yyyy] [name of copyright owner]
    19  *
    18  *
    20  * CDDL HEADER END
    19  * CDDL HEADER END
    21  */
    20  */
       
    21 
    22 /*
    22 /*
    23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
    23  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
    24  * Use is subject to license terms.
    24  * Use is subject to license terms.
    25  */
    25  */
    26 
       
    27 #pragma ident	"%Z%%M%	%I%	%E% SMI"
       
    28 
    26 
    29 /*	Copyright (c) 1988 AT&T	*/
    27 /*	Copyright (c) 1988 AT&T	*/
    30 /*	  All Rights Reserved  	*/
    28 /*	  All Rights Reserved  	*/
    31 
    29 
       
    30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
    32 
    31 
    33 /*
    32 /*
    34  * format a shadow file entry
    33  * format a shadow file entry
    35  *
    34  *
    36  * This code used to live in getspent.c
    35  * This code used to live in getspent.c
    37  */
    36  */
    38 
    37 
    39 #pragma weak putspent = _putspent
    38 #include "lint.h"
    40 
       
    41 #include "synonyms.h"
       
    42 #include <stdio.h>
    39 #include <stdio.h>
    43 #include <shadow.h>
    40 #include <shadow.h>
    44 
    41 
    45 int
    42 int
    46 putspent(const struct spwd *p, FILE *f)
    43 putspent(const struct spwd *p, FILE *f)
    47 {
    44 {
    48 	(void) fprintf(f, "%s:%s:", p->sp_namp,
    45 	(void) fprintf(f, "%s:%s:", p->sp_namp,
    49 		p->sp_pwdp ? p->sp_pwdp : "");
    46 	    p->sp_pwdp ? p->sp_pwdp : "");
    50 		/* pwdp could be null for +/- entries */
    47 		/* pwdp could be null for +/- entries */
    51 	if (p->sp_lstchg >= 0)
    48 	if (p->sp_lstchg >= 0)
    52 		(void) fprintf(f, "%d:", p->sp_lstchg);
    49 		(void) fprintf(f, "%d:", p->sp_lstchg);
    53 	else
    50 	else
    54 		(void) fprintf(f, ":");
    51 		(void) fprintf(f, ":");