aboutgitcodebugslistschat
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/util.c b/util.c
index 0aa4d42..4bc5d6f 100644
--- a/util.c
+++ b/util.c
@@ -38,6 +38,7 @@
#include "epoll_ctl.h"
#include "pasta.h"
#include "serialise.h"
+#include "conf.h"
#ifdef HAS_GETRANDOM
#include <sys/random.h>
#endif
@@ -939,15 +940,8 @@ void close_open_files(int argc, char **argv)
do {
name = getopt_long(argc, argv, "-:F:", optfd, NULL);
- if (name == 'F') {
- errno = 0;
- fd = strtol(optarg, NULL, 0);
-
- if (errno ||
- (fd != STDIN_FILENO && fd <= STDERR_FILENO) ||
- fd > INT_MAX)
- die("Invalid --fd: %s", optarg);
- }
+ if (name == 'F')
+ fd = conf_tap_fd(optarg);
} while (name != -1);
if (fd == -1) {