Movatterモバイル変換


[0]ホーム

URL:


This is the mail archive of thelibc-alpha@sourceware.orgmailing list for theglibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav:[Date Prev] [Date Next][Thread Prev] [Thread Next]
Other format:[Raw text]

[PATCH] resolv/resolv.h: allow alternative resolv.conf files


In network namespaces (like vdenshttps://github.com/rd235/vdens) it is sometimes necessary todefine per-namespace resolver configurations.The simple patch here attached permits the definition of an environment variabile to define thepath of the file to use instead of /etc/resolv.conf.e.g.:export PATH_RESCONF=/tmp/resolv.conf2017-08-17 Renzo Davoli <renzo@cs.unibo.it>diff --git a/resolv/resolv.h b/resolv/resolv.hindex e8c581ccd1..5e7a8143c3 100644--- a/resolv/resolv.h+++ b/resolv/resolv.h@@ -91,7 +91,10 @@  */  #ifndef _PATH_RESCONF-#define _PATH_RESCONF        "/etc/resolv.conf"+#define _PATH_RESCONF        ({ \+char *path_resconf = getenv("PATH_RESCONF"); \+path_resconf ? path_resconf : "/etc/resolv.conf"; \+}) #endif  struct res_sym {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav:[Date Prev] [Date Next][Thread Prev] [Thread Next]

[8]ページ先頭

©2009-2026 Movatter.jp