Commit 24678a9e authored by Timothy Stack's avatar Timothy Stack
Browse files

Before dumping a node-control log file, make sure the node directory

exists in the experiment log directory.
parent 6c728c7f
......@@ -7,6 +7,8 @@
#include "config.h"
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "systemf.h"
#include "rpc.h"
......@@ -169,6 +171,10 @@ static void dump_node_logs(int token, struct agent **agent_array, int aa_len,
char filename[1024];
FILE *file;
snprintf(filename, sizeof(filename),
NODE_DUMP_DIR,
agent_array[lpc]->name);
mkdir(filename, 0664);
snprintf(filename, sizeof(filename),
NODE_DUMP_FILE,
agent_array[lpc]->name, token);
......
......@@ -18,6 +18,7 @@
extern "C" {
#endif
#define NODE_DUMP_DIR "logs/%s"
#define NODE_DUMP_FILE "logs/%s/node-control.%d"
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment