Control protocol debugging.
<tag><label id="cli-dump">dump resources|sockets|interfaces|neighbors|attributes|routes|protocols "<m/file/"</tag>
- Truncates the given file and dumps contents of internal data structures
- there. By sending SIGUSR1, you get all of these concatenated to
- <cf/bird.dump/ in the current directory. The file is only readable for
- the user running the daemon. The format of dump files is internal and
- could change in the future.
+ Creates the given file (it must not exist) and dumps contents of
+ internal data structures there. By sending SIGUSR1, you get all of
+ these concatenated to <cf/bird.dump/ in the current directory.
+ The file is only readable for the user running the daemon.
+ The format of dump files is internal and could change in the future
+ without any notice.
<tag><label id="cli-echo">echo all|off|{ <m/list of log classes/ } [ <m/buffer-size/ ]</tag>
Control echoing of log messages to the command-line output.
dump_to_file_run(struct dump_request *dr, const char *file, const char *what, void (*dump)(struct dump_request *))
{
struct dump_request_file *req = SKIP_BACK(struct dump_request_file, dr, dr);
- req->fd = open(file, O_CREAT | O_WRONLY | O_TRUNC, S_IRUSR);
+ req->fd = open(file, O_CREAT | O_WRONLY | O_EXCL, S_IRUSR);
if (req->fd < 0)
{