diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2021-10-15 22:39:17 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2021-10-16 00:49:33 +0200 |
commit | 1fd0c9b0e1f27098f9bf86e86285335e640317a5 (patch) | |
tree | fc0f069c77ae83e8c7225f4fbbdd0194a0dcfaea /conf.c | |
parent | 14fe73e766206c71ab3c6d5ddc252435c36423bd (diff) | |
download | passt-1fd0c9b0e1f27098f9bf86e86285335e640317a5.tar passt-1fd0c9b0e1f27098f9bf86e86285335e640317a5.tar.gz passt-1fd0c9b0e1f27098f9bf86e86285335e640317a5.tar.bz2 passt-1fd0c9b0e1f27098f9bf86e86285335e640317a5.tar.lz passt-1fd0c9b0e1f27098f9bf86e86285335e640317a5.tar.xz passt-1fd0c9b0e1f27098f9bf86e86285335e640317a5.tar.zst passt-1fd0c9b0e1f27098f9bf86e86285335e640317a5.zip |
util, pasta: Don't read() and lseek() every single line in read_line()
...periodically checking bound ports becomes quite expensive
otherwise.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'conf.c')
-rw-r--r-- | conf.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -293,7 +293,7 @@ static void get_dns(struct ctx *c) if ((fd = open("/etc/resolv.conf", O_RDONLY)) < 0) goto out; - while (line_read(buf, BUFSIZ, fd)) { + while (!(*buf = 0) && line_read(buf, BUFSIZ, fd)) { if (!dns_set && strstr(buf, "nameserver ") == buf) { p = strrchr(buf, ' '); if (!p) |