Changeset View
Changeset View
Standalone View
Standalone View
head/devel/elfutils/files/patch-lib_eu-config.h
--- lib/eu-config.h.orig 2015-06-11 11:38:55 UTC | --- lib/eu-config.h.orig 2015-06-11 11:38:55 UTC | ||||
+++ lib/eu-config.h | +++ lib/eu-config.h | ||||
@@ -187,4 +187,147 @@ asm (".section predict_data, \"aw\"; .pr | @@ -187,4 +187,167 @@ asm (".section predict_data, \"aw\"; .pr | ||||
#endif | #endif | ||||
+/* FreeBSD ports of glibcisms */ | +/* FreeBSD ports of glibcisms */ | ||||
+#include <sys/cdefs.h> | +#include <sys/cdefs.h> | ||||
+#include <libgen.h> | +#include <libgen.h> | ||||
+#include <stdarg.h> | +#include <stdarg.h> | ||||
+#include <stdint.h> | +#include <stdint.h> | ||||
Show All 39 Lines | |||||
+} | +} | ||||
+ | + | ||||
+static inline char * | +static inline char * | ||||
+canonicalize_file_name(const char *path) | +canonicalize_file_name(const char *path) | ||||
+{ | +{ | ||||
+ | + | ||||
+ return (realpath(path, NULL)); | + return (realpath(path, NULL)); | ||||
+} | +} | ||||
+ | |||||
+/* | |||||
+ * A GNU-like basename(). | |||||
+ * | |||||
+ * Unlike POSIX basename(3), this version never modifies its argument. If the | |||||
+ * argument ends in a slash, it returns the empty string. | |||||
+ */ | |||||
+static inline char * | |||||
+eu_basename(const char *path) | |||||
+{ | |||||
+ const char *slash; | |||||
+ | |||||
+ slash = strrchr(path, '/'); | |||||
+ if (slash != NULL) | |||||
+ slash++; | |||||
+ else | |||||
+ slash = path; | |||||
+ return (__DECONST(char *, slash)); | |||||
+} | |||||
+#define basename eu_basename | |||||
+ | + | ||||
+#ifndef TEMP_FAILURE_RETRY | +#ifndef TEMP_FAILURE_RETRY | ||||
+#define TEMP_FAILURE_RETRY(expr) ({ \ | +#define TEMP_FAILURE_RETRY(expr) ({ \ | ||||
+ long value; \ | + long value; \ | ||||
+ do { \ | + do { \ | ||||
+ value = (long)(expr); \ | + value = (long)(expr); \ | ||||
+ } while (value == -1 && errno == EINTR); \ | + } while (value == -1 && errno == EINTR); \ | ||||
+ (value); \ | + (value); \ | ||||
▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines |