Close stdin on program launch.

It's unused and can give us an extra file descriptor.
This commit is contained in:
Érico Nogueira 2022-06-12 22:59:17 -03:00
parent fe0c1705b2
commit 3db1db5cf4
1 changed files with 3 additions and 0 deletions

3
erm.c
View File

@ -19,6 +19,9 @@ int main(int argc, char **argv)
bool recursive = false;
bool stop_at_error = true;
/* we don't use stdin, so give ourselves an extra fd */
fclose(stdin);
int opt;
while ((opt = getopt(argc, argv, "reh")) != -1) {
switch (opt) {