mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-ggsn.git
synced 2025-10-23 08:22:07 +00:00
ggsn/ggsn_vty: create state-dir
Prepare to change the state-dir in the default config in a follow-up commit. Create the directory if it does not exist. Change-Id: I91349fb284336a9de6af41475f1b824eb0e021b0
This commit is contained in:
@@ -22,6 +22,8 @@
|
|||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <osmocom/core/talloc.h>
|
#include <osmocom/core/talloc.h>
|
||||||
#include <osmocom/core/utils.h>
|
#include <osmocom/core/utils.h>
|
||||||
@@ -224,6 +226,11 @@ DEFUN(cfg_ggsn_state_dir, cfg_ggsn_state_dir_cmd,
|
|||||||
{
|
{
|
||||||
struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index;
|
struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index;
|
||||||
|
|
||||||
|
if (mkdir(argv[0], 0755) == -1 && errno != EEXIST) {
|
||||||
|
vty_out(vty, "%% Failed to create state-dir: %s%s", argv[0], VTY_NEWLINE);
|
||||||
|
return CMD_WARNING;
|
||||||
|
}
|
||||||
|
|
||||||
osmo_talloc_replace_string(ggsn, &ggsn->cfg.state_dir, argv[0]);
|
osmo_talloc_replace_string(ggsn, &ggsn->cfg.state_dir, argv[0]);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
|
Reference in New Issue
Block a user