Commit Graph

153 Commits

Author SHA1 Message Date
Panu Matilainen 7e65bec67d Revert "Only build bundled fts if system has a bad version that doesn't handle LFS"
The subtle test is too subtle for its own good, this patch breaks
thirty six testcases on 32bit architectures.

This reverts commit 1eadabe445.
2017-08-10 20:15:02 +03:00
Gleb Fotengauer-Malinovskiy fa06b68ed7 Drop local implementation of xsetprogname/xgetprogname
It can be dropped because this code was never actually enabled.
Actually, this implementation *surely* never ever compiled.

Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
2017-03-24 13:40:15 +02:00
Gleb Fotengauer-Malinovskiy 1eadabe445 Only build bundled fts if system has a bad version that doesn't handle LFS
Older versions of glibc included an fts implementation that didn't have
Large File Support on 32-bit systems.  We worked that around by bundling
fts into rpm codebase.  Thanks to Mark Wielaard, glibc >= 2.23 has LFS
support in fts.

Unfortunately, we can't drop bundled fts because we have to support
build with other libcs which do not implement fts at all or their
implementations do not provide Large File Support.

Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>

[pmatilai: Added comment to configure.ac as the test is rather subtle,
           thanks for Mark Wielaard for the explanation]
2017-03-24 12:42:40 +02:00
Gleb Fotengauer-Malinovskiy 418d1b69e1 Rename fts.h header to rpmfts.h
Make sure local fts.h is never included by mistake instead of system one.

Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
2017-03-24 12:29:24 +02:00
Ville Skyttä ebf6aa1be0 Spelling fixes 2016-06-04 23:00:58 +03:00
Florian Festi ad5ab9cf07 White space fixes 2016-02-11 14:08:58 +01:00
Kamil Rytarowski 61109446ac Reimplement setprogname() and getprogname() to be generic and portable
The RPM code contains setprogname()/getprogname() support implemented through compatiblity layer with very old GLIBC (internals supported back to '95 and earlier), before stabilization of the GNU C library. This compatiblity layer (__progname, __assert_progname, setprogname()) is supposed to support well archaic GLIBC, but on the other hand it pollutes the library namespace and introduces unpredicable compillation errors on BSD systems.

The functions setprogname() and getprogname() are natively supported in NetBSD and work the same way as __progname from the GNU C library (they are even implemented in the same way - but with a slightly changed logic). The support for very old (20 years and older) GNU C Library is obfuscating the code, because it uses defines over defines without a word of explaination why to do so.

It's important to note that the setprogname()/getprogname() was inconstiently implemented in the codebase, duplicating the code and/or functionality.

Add new generic functions getprogname() and setprogname() and bind it to:
- the current and for two decades stable GNU LIB C implementation,
- the current NetBSD implementation (introduces to NetBSD in 2002),
- fallback reimplementation functions of the setprogname() and getprogname() functionality for other systems.

Don't support anymore old GNU Lib C internals and don't support older NetBSD systems, as they aren't supported for many years.

Add to the codebase comments explaining the relevant codeparts.
2016-02-11 14:05:25 +01:00
Peter Eisentraut 159351d7f3 Add missing header files
They are generating warnings.
2016-02-11 11:06:26 +01:00
Neal Gompa (ニール・ゴンパ) ff3e57c343 Fix fstat64 conditional and definition typo
So, as it turns out, pretty much all libc implementations
except for legacy ones implement it as fstat64(), so we
will use fstat64() unless otherwise necessary.

Also, fix typo in checking for _D_EXACT_NAMLEN definition.
2015-11-13 15:07:42 +01:00
Neal Gompa (ニール・ゴンパ) 4f7c802ebe Set up portable definitions to support μClibc and MUSL
The definitions were refactored because musl-libc does
not offer a __MUSL__ definition and μClibc tries to
identify as glibc, even though it's not quite compatible.

A nice side effect of this is that the platform support
definitions are somewhat simpler now.
2015-11-12 14:57:37 +01:00
n54@gmx.com 1d71a307e9 Get rid of redefinitions of __BEGIN_DECLS and __END_DECLS
__BEGIN_DECLS and __END_DECLS are already defined in the NetBSD's standard C
library as an internal definition and redefinition of it causes errors.
The possible solutions are to rename the definitions or take rid of them.

Actually __BEGIN_DECLS and __END_DECLS are used only once and encapsulate
'extern "C" {' and '}', so they aren't really helping more then obfuscating
the code.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2013-08-15 07:43:04 +03:00
Ville Skyttä 8002b3f985 Spelling fixes.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2013-02-19 21:35:40 +02:00
Panu Matilainen bf088dbeb5 Bury our glob() implementation entirely inside rpmglob.c (RhBug:819680)
- Lump glob.h and glob.c into rpmglob.c in all their g(l)ory libc
  decorations and make everything static to stop overriding system
  library symbols with our own glob().
2012-05-31 16:46:40 +03:00
Panu Matilainen 5cd1e56cd2 Enable GLOB_ONLYDIR of the bundled glob() on platforms that support it 2011-06-28 08:37:41 +03:00
Panu Matilainen 0d70636c6d Fix misc/ include path
- -I$(top_builddir)/include/rpm was never right, and now with fts
  moved into misc/ this shows as rpm/rpmutil.h not getting found.
2010-10-12 09:27:46 +03:00
Panu Matilainen 84747fb22e Stuff fts into a convenience library in misc/
- This is not really native rpm code but a copy of (glibc?) FTS
  implementation, with slight modification to avoid symbol name
  collisions. Stick it where the sun don't shine, we'd eventually
  like to get rid of such bundled external code.
2010-10-01 11:22:13 +03:00
Richard Hughes 16b94706e0 Fix compile when using a linker that defaults to --no-as-needed 2010-02-04 17:59:19 +02:00
Panu Matilainen 37daae03c1 Kill off couple of dangling lib/fs.c references 2010-02-03 17:36:45 +02:00
Florian Festi 51c96db046 Kill RPMTAG_FSNAMES and RPMTAG_FSSIZES and everything implementing them 2010-02-03 16:27:00 +01:00
Panu Matilainen e3638c2c86 Remove <string.h> include from system.h into the few places that still need
- most of the places get it through <rpm/rpmstring.h> already
2010-01-05 15:17:34 +02:00
Panu Matilainen 0c15e5feb3 Include <stdlib.h> as necessary instead of system.h
- also loose the related ancient compatibility goo
2010-01-05 15:04:20 +02:00
Panu Matilainen 3125bac65f Lose the hysterical fakefork hack
- we're not particularly interested in AmigaOS quirks from 1996
2010-01-04 15:27:25 +02:00
Panu Matilainen 33404070cd Remove further replacement functions for POSIX 2001 required bits
- getwd(), getcwd(), basename() and realpath() are all POSIX 2001
  defined, we dont care about older stuff
2010-01-04 15:27:05 +02:00
Panu Matilainen bb803d630c Remove unnecessary setenv() replacement function
- setenv() and unsetenv() are required by POSIX 2001, we dont care about
  older systems
2010-01-04 14:21:42 +02:00
Panu Matilainen 580f9625e1 Remove largely unnecessary putenv() replacement
- only the lua posix extension "uses" this by providing putenv()
  to Lua, make it conditional and return error if not supported by
  the underlying operating system
2010-01-04 14:15:20 +02:00
Panu Matilainen 60dc809db1 Eliminate myrealloc() replacement function
- realloc(NULL, size) is defined as equal to malloc(size) in C99 and
  POSIX 2001, we dont care about anything older than that
2010-01-04 13:46:43 +02:00
Panu Matilainen 216cf2acb6 Remove unneeded strdup() replacement in misc/
- rpmio's own version is always there and portable, this is not needed
2010-01-04 13:34:39 +02:00
Panu Matilainen 05dcdf44d0 Use rpm's own strdup() clone everywhere 2010-01-04 13:30:14 +02:00
Panu Matilainen 7c62eb237f Remove replacements for C99 mandated functions
- rpm requires C99 compiler anyway, no point in carrying these around
2009-12-23 14:52:49 +02:00
Panu Matilainen 5741334a85 Remove unneeded replacement error/warn functions 2009-12-23 14:37:14 +02:00
Panu Matilainen 2753a5e934 Dont include <pwd.h> from system.h, dont bother checking for it either
- no much point conditionalizing something we can't live without
- just three places need, no point polluting include space everywhere
2009-12-23 13:40:10 +02:00
Panu Matilainen 759b73a429 Ensure PATH_MAX is defined (ticket #3) Adam Tkac
- POSIX doesn't require PATH_MAX to be defined as constant, and Hurd
  doesn't define it...
- deal with it just once in system.h for now, the proper fix is to get
  rid of needing it at all (ie add a mallocing realpath() clone to librpmio)
- patch from Adam Tkac
2008-11-03 14:14:14 +02:00
Panu Matilainen a306a04a89 RIP alloca() 2008-04-30 14:38:09 +03:00
Ralf Corsépius 94d2343931 Add -I$(top_builddir)/include/rpm to AM_CPPFLAGS. 2007-11-22 16:17:20 +01:00
Ralf Corsépius e898dde44d Remove memcmp.c. 2007-10-30 15:24:10 +01:00
Ralf Corsépius d57d710550 Build libmisc.la.
Use @LTLIBOBJS@.
2007-10-30 12:15:34 +01:00
Ralf Corsépius bb3c8db9a5 Include "config.h" instead of <config.h>. 2007-10-28 06:57:08 +01:00
Ralf Corsépius ea2968b6b3 Cleanup CPPFLAGS. 2007-10-17 16:41:59 +02:00
Ralf Corsépius 343effc65f Remove (unused). 2007-10-01 13:17:15 +02:00
Ralf Corsépius 65cbae7709 Remove splint tags. 2007-09-11 23:26:22 +02:00
Ralf Corsépius ea253c1e51 Eliminate noinst_HEADERS. 2007-09-10 10:31:37 +02:00
Ralf Corsépius 75ae38e37c Remove INCPATH. 2007-08-22 11:54:31 +02:00
Panu Matilainen 8d2b416782 Automake cleanups.
- Replace INCLUDES with AM_CPPFLAGS
  (INCLUDES has been replaced by AM_CPPFLAGS and is deprecated in
  modern automakes for several years)
- Require autoconf-2.61 and automake-1.10
  (already required by autogen.sh)
- update mkinstalldirs with the version from automake-1.10
  (The version in rpm is ancient and known to be bugged)

Patch from Ralf Corsepius
2007-08-05 11:30:55 +03:00
Panu Matilainen cd4fb0f9f4 Silence yet another char ptr signedness warning 2007-07-12 10:00:43 +03:00
jbj fadd9c8edb Revert glob/fnmatch/alloca uniqify on macosx for now.
CVS patchset: 7717
CVS date: 2005/01/28 06:36:29
2005-01-28 06:36:29 +00:00
jbj 84d6a9cac5 macosx/opendarwin hackery, take 1.
CVS patchset: 7710
CVS date: 2005/01/25 05:24:40
2005-01-25 05:24:40 +00:00
jbj 9e1bfe0af5 - blueprint rpm-4_4 and HEAD to minimize diff spew.
CVS patchset: 7706
CVS date: 2005/01/23 20:44:57
2005-01-23 20:44:57 +00:00
jbj 217c588baa Build on macosx.
CVS patchset: 7701
CVS date: 2005/01/17 23:58:09
2005-01-17 23:58:09 +00:00
jbj c7510bceec build rpm-4.4.1-0.6.
CVS patchset: 7674
CVS date: 2005/01/05 04:46:01
2005-01-05 04:46:01 +00:00
jbj 84ec406c35 - mac os x patches (#133611, #133612, #134637).
CVS patchset: 7673
CVS date: 2005/01/04 19:31:31
2005-01-04 19:31:31 +00:00