]> git.puffer.fish Git - mirror/frr.git/commitdiff
vtysh: Include fnctl.h for vtysh_main
authorDonatas Abraitis <donatas@opensourcerouting.org>
Thu, 29 Feb 2024 12:21:27 +0000 (14:21 +0200)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Sat, 9 Mar 2024 07:33:40 +0000 (09:33 +0200)
Fixing compilation for Alpine Linux:

```
25 91.59 vtysh/vtysh_main.c: In function 'vtysh_flock_config':
25 91.59 vtysh/vtysh_main.c:276:20: warning: implicit declaration of function 'open'; did you mean 'popen'? [-Wimplicit-function-declaration]
25 91.59   276 |         flock_fd = open(flock_file, O_RDONLY, 0644);
25 91.59       |                    ^~~~
25 91.59       |                    popen
25 91.60 vtysh/vtysh_main.c:276:37: error: 'O_RDONLY' undeclared (first use in this function)
25 91.60   276 |         flock_fd = open(flock_file, O_RDONLY, 0644);
25 91.60       |                                     ^~~~~~~~
25 91.60 vtysh/vtysh_main.c:276:37: note: each undeclared identifier is reported only once for each function it appears in
25 91.60   CC       zebra/if_netlink.o
25 91.61 vtysh/vtysh_main.c: In function 'main':
25 91.61 vtysh/vtysh_main.c:637:49: error: 'O_CREAT' undeclared (first use in this function)
25 91.61   637 |                         fp = open(history_file, O_CREAT | O_EXCL,
25 91.61       |                                                 ^~~~~~~
25 91.62 vtysh/vtysh_main.c:637:59: error: 'O_EXCL' undeclared (first use in this function)
25 91.62   637 |                         fp = open(history_file, O_CREAT | O_EXCL,
25 91.62       |                                                           ^~~~~~
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
vtysh/vtysh_main.c

index b1299780db5339909537928de158860267715823..464d82cf7fee9a4ad1b97aca1471ec7dcc4029ad 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <zebra.h>
 
+#include <fcntl.h>
 #include <signal.h>
 #include <sys/stat.h>
 #include <sys/un.h>