Deleted Added
full compact
pututxline.c (202287) pututxline.c (202530)
1/*-
2 * Copyright (c) 2010 Ed Schouten <ed@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2010 Ed Schouten <ed@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/lib/libc/gen/pututxline.c 202287 2010-01-14 15:20:09Z ed $");
28__FBSDID("$FreeBSD: head/lib/libc/gen/pututxline.c 202530 2010-01-17 21:40:05Z ed $");
29
30#include "namespace.h"
31#include <sys/endian.h>
32#include <sys/stat.h>
33#include <sys/uio.h>
34#include <fcntl.h>
35#include <stdio.h>
36#include <string.h>

--- 198 unchanged lines hidden (view full) ---

235 _writev(fd, vec, 2);
236 _close(fd);
237}
238
239struct utmpx *
240pututxline(const struct utmpx *utmpx)
241{
242 struct futx fu;
29
30#include "namespace.h"
31#include <sys/endian.h>
32#include <sys/stat.h>
33#include <sys/uio.h>
34#include <fcntl.h>
35#include <stdio.h>
36#include <string.h>

--- 198 unchanged lines hidden (view full) ---

235 _writev(fd, vec, 2);
236 _close(fd);
237}
238
239struct utmpx *
240pututxline(const struct utmpx *utmpx)
241{
242 struct futx fu;
243 static struct utmpx ut;
244
245 utx_to_futx(utmpx, &fu);
246
247 switch (fu.fu_type) {
248 case BOOT_TIME:
249 case SHUTDOWN_TIME:
250 utx_active_purge();
251 utx_lastlogin_upgrade();

--- 15 unchanged lines hidden (view full) ---

267 if (utx_active_remove(&fu) != 0)
268 return (NULL);
269 break;
270 default:
271 return (NULL);
272 }
273
274 utx_log_add(&fu);
243
244 utx_to_futx(utmpx, &fu);
245
246 switch (fu.fu_type) {
247 case BOOT_TIME:
248 case SHUTDOWN_TIME:
249 utx_active_purge();
250 utx_lastlogin_upgrade();

--- 15 unchanged lines hidden (view full) ---

266 if (utx_active_remove(&fu) != 0)
267 return (NULL);
268 break;
269 default:
270 return (NULL);
271 }
272
273 utx_log_add(&fu);
275 futx_to_utx(&fu, &ut);
276 return (&ut);
274 return (futx_to_utx(&fu));
277}
275}