go-dnsclient.patch 506 B

12345678910111213141516171819202122232425
  1. 265,270d264
  2. < // Ensure only one update at a time checks resolv.conf.
  3. < if !conf.tryAcquireSema() {
  4. < return
  5. < }
  6. < defer conf.releaseSema()
  7. <
  8. 276a271,280
  9. > conf.update(name)
  10. > }
  11. >
  12. > func (conf *resolverConfig) update(name string) {
  13. > // Ensure only one update at a time checks resolv.conf.
  14. > if !conf.tryAcquireSema() {
  15. > return
  16. > }
  17. > defer conf.releaseSema()
  18. >
  19. 293a298,302
  20. > }
  21. >
  22. > func UpdateDnsConf() {
  23. > resolvConf.initOnce.Do(resolvConf.init)
  24. > resolvConf.update("/etc/resolv.conf")