diff options
-rw-r--r-- | build/files.c | 14 | ||||
-rw-r--r-- | build/pack.c | 4 | ||||
-rw-r--r-- | build/parseSpec.c | 2 | ||||
-rw-r--r-- | build/policies.c | 4 | ||||
-rw-r--r-- | cliutils.c | 2 | ||||
-rw-r--r-- | lib/backend/dbiset.c | 2 | ||||
-rw-r--r-- | lib/backend/ndb/rpmxdb.c | 2 | ||||
-rw-r--r-- | lib/cpio.c | 4 | ||||
-rw-r--r-- | lib/fsm.c | 8 | ||||
-rw-r--r-- | lib/rpmds.c | 4 | ||||
-rw-r--r-- | lib/rpmrc.c | 4 | ||||
-rw-r--r-- | lib/transaction.c | 6 | ||||
-rw-r--r-- | lib/verify.c | 10 | ||||
-rw-r--r-- | rpmio/lposix.c | 2 | ||||
-rw-r--r-- | rpmio/macro.c | 4 | ||||
-rw-r--r-- | rpmio/rpmio.c | 12 | ||||
-rw-r--r-- | rpmspec.c | 2 | ||||
-rw-r--r-- | system.h | 8 |
18 files changed, 47 insertions, 47 deletions
diff --git a/build/files.c b/build/files.c index 4cc8df5be..e0626155d 100644 --- a/build/files.c +++ b/build/files.c @@ -12,11 +12,11 @@ #include <stdlib.h> #include <regex.h> #include <fcntl.h> -#if WITH_CAP +#ifdef WITH_CAP #include <sys/capability.h> #endif -#if HAVE_LIBDW +#ifdef HAVE_LIBDW #include <libelf.h> #include <elfutils/libdwelf.h> #endif @@ -826,7 +826,7 @@ static rpmRC parseForCaps(char * buf, FileEntry cur) while (p <= pe) *p++ = ' '; -#if WITH_CAP +#ifdef WITH_CAP { char *captxt = NULL; cap_t fcaps = cap_from_text(q); @@ -1695,7 +1695,7 @@ static void argvAddAttr(ARGV_t *filesp, rpmfileAttrs attrs, const char *path) free(line); } -#if HAVE_LIBDW +#ifdef HAVE_LIBDW /* How build id links are generated. See macros.in for description. */ #define BUILD_IDS_NONE 0 #define BUILD_IDS_ALLDEBUG 1 @@ -1878,7 +1878,7 @@ static int generateBuildIDs(FileList fl, ARGV_t *files) kernel modules (ET_REL files with .modinfo section) should have build-ids. */ GElf_Ehdr ehdr; -#if HAVE_DWELF_ELF_BEGIN +#ifdef HAVE_DWELF_ELF_BEGIN Elf *elf = dwelf_elf_begin(fd); #else Elf *elf = elf_begin (fd, ELF_C_READ, NULL); @@ -2624,7 +2624,7 @@ static rpmRC processPackageFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags, if (fl.processingFailed) goto exit; -#if HAVE_LIBDW +#ifdef HAVE_LIBDW /* Check build-ids and add build-ids links for files to package list. */ const char *arch = headerGetString(pkg->header, RPMTAG_ARCH); if (!rstreq(arch, "noarch")) { @@ -3136,7 +3136,7 @@ rpmRC processBinaryFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags, should Recommend. */ Package dbgsrcpkg = findDebugsourcePackage(spec); -#if HAVE_LIBDW +#ifdef HAVE_LIBDW elf_version (EV_CURRENT); #endif check_fileList = newStringBuf(); diff --git a/build/pack.c b/build/pack.c index 0351963ba..e37c4e899 100644 --- a/build/pack.c +++ b/build/pack.c @@ -297,13 +297,13 @@ static char *getIOFlags(Package pkg) compr = NULL; } else if (rstreq(s+1, "gzdio")) { compr = "gzip"; -#if HAVE_BZLIB_H +#ifdef have_bzlib_h } else if (rstreq(s+1, "bzdio")) { compr = "bzip2"; /* Add prereq on rpm version that understands bzip2 payloads */ (void) rpmlibNeedsFeature(pkg, "PayloadIsBzip2", "3.0.5-1"); #endif -#if HAVE_LZMA_H +#ifdef HAVE_LZMA_H } else if (rstreq(s+1, "xzdio")) { compr = "xz"; (void) rpmlibNeedsFeature(pkg, "PayloadIsXz", "5.2-1"); diff --git a/build/parseSpec.c b/build/parseSpec.c index 18c480d6e..85131d8f9 100644 --- a/build/parseSpec.c +++ b/build/parseSpec.c @@ -768,7 +768,7 @@ static void addTargets(Package Pkgs) rpmRC checkForEncoding(Header h, int addtag) { rpmRC rc = RPMRC_OK; -#if HAVE_ICONV +#ifdef HAVE_ICONV const char *encoding = "utf-8"; rpmTagVal tag; iconv_t ic; diff --git a/build/policies.c b/build/policies.c index a5a56df4c..78899ebb6 100644 --- a/build/policies.c +++ b/build/policies.c @@ -15,7 +15,7 @@ #include "debug.h" -#if WITH_SELINUX +#ifdef WITH_SELINUX enum rpmpolFlags_e { RPMPOL_FLAG_NONE = 0, RPMPOL_FLAG_BASE = (1 << 0) @@ -305,7 +305,7 @@ static rpmRC processPolicies(rpmSpec spec, Package pkg, int test) rpmRC processBinaryPolicies(rpmSpec spec, int test) { rpmRC rc = RPMRC_OK; -#if WITH_SELINUX +#ifdef WITH_SELINUX Package pkg; char *nvr; diff --git a/cliutils.c b/cliutils.c index 772a105ec..d3d65d95a 100644 --- a/cliutils.c +++ b/cliutils.c @@ -1,5 +1,5 @@ #include "system.h" -#if HAVE_MCHECK_H +#ifdef HAVE_MCHECK_H #include <mcheck.h> #endif #include <errno.h> diff --git a/lib/backend/dbiset.c b/lib/backend/dbiset.c index 8fb922ef7..b36bfb4f1 100644 --- a/lib/backend/dbiset.c +++ b/lib/backend/dbiset.c @@ -46,7 +46,7 @@ void dbiIndexSetSort(dbiIndexSet set) * than pure quicksort, but glibc uses msort_with_tmp() on stack. */ if (set && set->recs && set->count > 1) { -#if HAVE_MERGESORT +#ifdef HAVE_MERGESORT mergesort(set->recs, set->count, sizeof(*set->recs), hdrNumCmp); #else qsort(set->recs, set->count, sizeof(*set->recs), hdrNumCmp); diff --git a/lib/backend/ndb/rpmxdb.c b/lib/backend/ndb/rpmxdb.c index 073e38fd8..d86ee8ca4 100644 --- a/lib/backend/ndb/rpmxdb.c +++ b/lib/backend/ndb/rpmxdb.c @@ -113,7 +113,7 @@ static inline void h2lea(unsigned int x, unsigned char *p) static void *mapmem(void *oldaddr, size_t oldsize, size_t newsize, int prot, int fd, off_t offset) { if (oldaddr) { -#if HAVE_MREMAP +#ifdef HAVE_MREMAP return mremap(oldaddr, oldsize, newsize, MREMAP_MAYMOVE); #else void *mapped = mmap(0, newsize, prot, MAP_SHARED, fd, offset); diff --git a/lib/cpio.c b/lib/cpio.c index e029ba929..921434007 100644 --- a/lib/cpio.c +++ b/lib/cpio.c @@ -9,9 +9,9 @@ #include "system.h" -#if MAJOR_IN_MKDEV +#if defined(MAJOR_IN_MKDEV) #include <sys/mkdev.h> -#elif MAJOR_IN_SYSMACROS +#elif defined(MAJOR_IN_SYSMACROS) #include <sys/sysmacros.h> #else #include <sys/types.h> /* already included from system.h */ @@ -9,7 +9,7 @@ #include <utime.h> #include <errno.h> #include <fcntl.h> -#if WITH_CAP +#ifdef WITH_CAP #include <sys/capability.h> #endif @@ -95,7 +95,7 @@ static int fsmLink(int odirfd, const char *opath, int dirfd, const char *path) return rc; } -#if WITH_CAP +#ifdef WITH_CAP static int cap_set_fileat(int dirfd, const char *path, cap_t fcaps) { int rc = -1; @@ -112,7 +112,7 @@ static int fsmSetFCaps(int fd, int dirfd, const char *path, const char *captxt) { int rc = 0; -#if WITH_CAP +#ifdef WITH_CAP if (captxt && *captxt != '\0') { cap_t fcaps = cap_from_text(captxt); @@ -469,7 +469,7 @@ static void removeSBITS(int dirfd, const char *path) if ((stb.st_mode & 06000) != 0) { (void) fchmodat(dirfd, path, stb.st_mode & 0777, flags); } -#if WITH_CAP +#ifdef WITH_CAP if (stb.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)) { (void) cap_set_fileat(dirfd, path, NULL); } diff --git a/lib/rpmds.c b/lib/rpmds.c index c0628a4e0..c156c32c3 100644 --- a/lib/rpmds.c +++ b/lib/rpmds.c @@ -1069,12 +1069,12 @@ static const struct rpmlibProvides_s rpmlibProvides[] = { { "rpmlib(CompressedFileNames)", "3.0.4-1", (RPMSENSE_RPMLIB|RPMSENSE_EQUAL), N_("file name(s) stored as (dirName,baseName,dirIndex) tuple, not as path.")}, -#if HAVE_BZLIB_H +#ifdef HAVE_BZLIB_H { "rpmlib(PayloadIsBzip2)", "3.0.5-1", (RPMSENSE_RPMLIB|RPMSENSE_EQUAL), N_("package payload can be compressed using bzip2.") }, #endif -#if HAVE_LZMA_H +#ifdef HAVE_LZMA_H { "rpmlib(PayloadIsXz)", "5.2-1", (RPMSENSE_RPMLIB|RPMSENSE_EQUAL), N_("package payload can be compressed using xz.") }, diff --git a/lib/rpmrc.c b/lib/rpmrc.c index 15832289f..0e445002c 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -10,12 +10,12 @@ #endif -#if HAVE_SYS_UTSNAME_H +#ifdef HAVE_SYS_UTSNAME_H #include <sys/utsname.h> #endif #include <ctype.h> /* XXX for /etc/rpm/platform contents */ -#if HAVE_SYS_SYSTEMCFG_H +#ifdef HAVE_SYS_SYSTEMCFG_H #include <sys/systemcfg.h> #else #define __power_pc() 0 diff --git a/lib/transaction.c b/lib/transaction.c index 3b878b788..7bdc17722 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -11,9 +11,9 @@ #include <fcntl.h> /* duplicated from cpio.c */ -#if MAJOR_IN_MKDEV +#if defined(MAJOR_IN_MKDEV) #include <sys/mkdev.h> -#elif MAJOR_IN_SYSMACROS +#elif defined(MAJOR_IN_SYSMACROS) #include <sys/sysmacros.h> #else #include <sys/types.h> /* already included from system.h */ @@ -1748,7 +1748,7 @@ static void rpmtsSync(rpmts ts) if (rpmChrootDone()) return; -#if HAVE_SYNCFS +#ifdef HAVE_SYNCFS for (rpmDiskSpaceInfo dsi = ts->dsi; dsi->bsize; dsi++) { int fd = open(dsi->mntPoint, O_RDONLY); if (fd != -1) { diff --git a/lib/verify.c b/lib/verify.c index 66647e96e..154274593 100644 --- a/lib/verify.c +++ b/lib/verify.c @@ -7,10 +7,10 @@ #include <errno.h> #include <fcntl.h> -#if WITH_CAP +#ifdef WITH_CAP #include <sys/capability.h> #endif -#if WITH_ACL +#ifdef WITH_ACL #include <acl/libacl.h> #endif @@ -33,7 +33,7 @@ #define S_ISDEV(m) (S_ISBLK((m)) || S_ISCHR((m))) /* If cap_compare() (Linux extension) not available, do it the hard way */ -#if WITH_CAP && !defined(HAVE_CAP_COMPARE) +#if defined(WITH_CAP) && !defined(HAVE_CAP_COMPARE) static int cap_compare(cap_t acap, cap_t bcap) { int rc = 0; @@ -176,7 +176,7 @@ rpmVerifyAttrs rpmfilesVerify(rpmfiles fi, int ix, rpmVerifyAttrs omitMask) if (metamode != filemode) vfy |= RPMVERIFY_MODE; -#if WITH_ACL +#ifdef WITH_ACL /* * For now, any non-default acl's on a file is a difference as rpm * cannot have set them. @@ -204,7 +204,7 @@ rpmVerifyAttrs rpmfilesVerify(rpmfiles fi, int ix, rpmVerifyAttrs omitMask) } } -#if WITH_CAP +#ifdef WITH_CAP if (flags & RPMVERIFY_CAPS) { cap_t cap = NULL; cap_t fcap = cap_get_file(fn); diff --git a/rpmio/lposix.c b/rpmio/lposix.c index a3f4852cf..a8c52f2ff 100644 --- a/rpmio/lposix.c +++ b/rpmio/lposix.c @@ -388,7 +388,7 @@ static int Psleep(lua_State *L) /** sleep(seconds) */ static int Pputenv(lua_State *L) /** putenv(string) */ { -#if HAVE_PUTENV +#ifdef HAVE_PUTENV size_t l; const char *s=luaL_checklstring(L, 1, &l); char *e=malloc(++l); diff --git a/rpmio/macro.c b/rpmio/macro.c index 6b0201a4c..7aa9f0fd7 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -6,7 +6,7 @@ #include <stdarg.h> #include <pthread.h> #include <errno.h> -#if HAVE_SCHED_GETAFFINITY +#ifdef HAVE_SCHED_GETAFFINITY #include <sched.h> #endif @@ -600,7 +600,7 @@ exit: static unsigned int getncpus(void) { unsigned int ncpus = 0; -#if HAVE_SCHED_GETAFFINITY +#ifdef HAVE_SCHED_GETAFFINITY cpu_set_t set; if (sched_getaffinity (0, sizeof(set), &set) == 0) ncpus = CPU_COUNT(&set); diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index 0fc088aa1..343cc312b 100644 --- a/rpmio/rpmio.c +++ b/rpmio/rpmio.c @@ -151,7 +151,7 @@ struct FDIO_s { static const FDIO_t fdio; static const FDIO_t ufdio; static const FDIO_t gzdio; -#if HAVE_BZLIB_H +#ifdef HAVE_BZLIB_H static const FDIO_t bzdio; #endif #ifdef HAVE_LZMA_H @@ -617,7 +617,7 @@ static int gzdSeek(FDSTACK_t fps, off_t pos, int whence) { off_t p = pos; int rc; -#if HAVE_GZSEEK +#ifdef HAVE_GZSEEK gzFile gzfile = fps->fp; if (gzfile == NULL) return -2; /* XXX can't happen */ @@ -649,7 +649,7 @@ static off_t gzdTell(FDSTACK_t fps) gzFile gzfile = fps->fp; if (gzfile != NULL) { -#if HAVE_GZSEEK +#ifdef HAVE_GZSEEK pos = gztell(gzfile); if (pos < 0) gzdSetError(fps); @@ -668,7 +668,7 @@ static const FDIO_t gzdio = &gzdio_s ; /* =============================================================== */ /* Support for BZIP2 library. */ -#if HAVE_BZLIB_H +#ifdef HAVE_BZLIB_H #include <bzlib.h> @@ -1547,10 +1547,10 @@ static FDIO_t findIOT(const char *name) &fdio_s, &ufdio_s, &gzdio_s, -#if HAVE_BZLIB_H +#ifdef HAVE_BZLIB_H &bzdio_s, #endif -#if HAVE_LZMA_H +#ifdef HAVE_LZMA_H &xzdio_s, &lzdio_s, #endif @@ -30,7 +30,7 @@ static struct poptOption specOptsTable[] = { N_("parse spec file(s) to stdout"), NULL }, { "query", 'q', POPT_ARG_VAL, &mode, MODE_QUERY, N_("query spec file(s)"), NULL }, -#if HAVE_READLINE +#ifdef HAVE_READLINE { "shell", 0, POPT_ARG_VAL, &mode, MODE_SHELL, N_("interactive macro shell"), NULL }, #endif @@ -29,13 +29,13 @@ extern char ** environ; #endif #endif -#if HAVE_SECURE_GETENV +#if defined(HAVE_SECURE_GETENV) #define getenv(_s) secure_getenv(_s) -#elif HAVE___SECURE_GETENV +#elif defined(HAVE___SECURE_GETENV) #define getenv(_s) __secure_getenv(_s) #endif -#if HAVE_LIMITS_H +#ifdef HAVE_LIMITS_H #include <limits.h> #endif @@ -82,7 +82,7 @@ extern int fdatasync(int fildes); #endif /* Take care of NLS matters. */ -#if ENABLE_NLS +#if defined(ENABLE_NLS) # include <locale.h> # include <libintl.h> # define _(Text) dgettext (PACKAGE, Text) |