Deleted Added
full compact
msgcat.c (204110) msgcat.c (241046)
1/***********************************************************
2Copyright 1990, by Alfalfa Software Incorporated, Cambridge, Massachusetts.
3Copyright 2010, Gabor Kovesdan <gabor@FreeBSD.org>
4
5 All Rights Reserved
6
7Permission to use, copy, modify, and distribute this software and its
8documentation for any purpose and without fee is hereby granted,

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

27 Alfalfa Software, Inc.
28 267 Allston St., #3
29 Cambridge, MA 02139 USA
30 nazgul@alfalfa.com
31
32******************************************************************/
33
34#include <sys/cdefs.h>
1/***********************************************************
2Copyright 1990, by Alfalfa Software Incorporated, Cambridge, Massachusetts.
3Copyright 2010, Gabor Kovesdan <gabor@FreeBSD.org>
4
5 All Rights Reserved
6
7Permission to use, copy, modify, and distribute this software and its
8documentation for any purpose and without fee is hereby granted,

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

27 Alfalfa Software, Inc.
28 267 Allston St., #3
29 Cambridge, MA 02139 USA
30 nazgul@alfalfa.com
31
32******************************************************************/
33
34#include <sys/cdefs.h>
35__FBSDID("$FreeBSD: head/lib/libc/nls/msgcat.c 204110 2010-02-20 08:19:19Z gabor $");
35__FBSDID("$FreeBSD: head/lib/libc/nls/msgcat.c 241046 2012-09-29 11:54:34Z jilles $");
36
37#define _NLS_PRIVATE
38
39#include "namespace.h"
40#include <sys/types.h>
41#include <sys/stat.h>
42#include <sys/mman.h>
43#include <sys/queue.h>

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

379 if ((np->path != NULL) && (strcmp(np->path, path) == 0)) {
380 np->refcount++;
381 UNLOCK;
382 return (np->catd);
383 }
384 }
385 UNLOCK;
386
36
37#define _NLS_PRIVATE
38
39#include "namespace.h"
40#include <sys/types.h>
41#include <sys/stat.h>
42#include <sys/mman.h>
43#include <sys/queue.h>

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

379 if ((np->path != NULL) && (strcmp(np->path, path) == 0)) {
380 np->refcount++;
381 UNLOCK;
382 return (np->catd);
383 }
384 }
385 UNLOCK;
386
387 if ((fd = _open(path, O_RDONLY)) == -1) {
387 if ((fd = _open(path, O_RDONLY | O_CLOEXEC)) == -1) {
388 SAVEFAIL(name, lang, errno);
389 NLRETERR(errno);
390 }
391
392 if (_fstat(fd, &st) != 0) {
393 _close(fd);
394 SAVEFAIL(name, lang, EFTYPE);
395 NLRETERR(EFTYPE);

--- 52 unchanged lines hidden ---
388 SAVEFAIL(name, lang, errno);
389 NLRETERR(errno);
390 }
391
392 if (_fstat(fd, &st) != 0) {
393 _close(fd);
394 SAVEFAIL(name, lang, EFTYPE);
395 NLRETERR(EFTYPE);

--- 52 unchanged lines hidden ---