main: create /run/NetworkManager/devices runtime directory
This commit is contained in:
@@ -34,6 +34,7 @@
|
|||||||
|
|
||||||
#include "main-utils.h"
|
#include "main-utils.h"
|
||||||
#include "NetworkManagerUtils.h"
|
#include "NetworkManagerUtils.h"
|
||||||
|
#include "nm-config.h"
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
sighup_handler (gpointer user_data)
|
sighup_handler (gpointer user_data)
|
||||||
@@ -139,11 +140,23 @@ nm_main_utils_ensure_statedir ()
|
|||||||
void
|
void
|
||||||
nm_main_utils_ensure_rundir ()
|
nm_main_utils_ensure_rundir ()
|
||||||
{
|
{
|
||||||
|
int errsv;
|
||||||
|
|
||||||
/* Setup runtime directory */
|
/* Setup runtime directory */
|
||||||
if (g_mkdir_with_parents (NMRUNDIR, 0755) != 0) {
|
if (g_mkdir_with_parents (NMRUNDIR, 0755) != 0) {
|
||||||
fprintf (stderr, _("Cannot create '%s': %s"), NMRUNDIR, strerror (errno));
|
errsv = errno;
|
||||||
|
fprintf (stderr, _("Cannot create '%s': %s"), NMRUNDIR, g_strerror (errsv));
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nm_assert (g_str_has_prefix (NM_CONFIG_DEVICE_STATE_DIR, NMRUNDIR"/"));
|
||||||
|
if (g_mkdir (NM_CONFIG_DEVICE_STATE_DIR, 0755) != 0) {
|
||||||
|
errsv = errno;
|
||||||
|
if (errsv != EEXIST) {
|
||||||
|
fprintf (stderr, _("Cannot create '%s': %s"), NM_CONFIG_DEVICE_STATE_DIR, g_strerror (errsv));
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -185,5 +185,11 @@ gboolean nm_config_set_global_dns (NMConfig *self, NMGlobalDnsConfig *global_dns
|
|||||||
extern guint _nm_config_match_nm_version;
|
extern guint _nm_config_match_nm_version;
|
||||||
extern char *_nm_config_match_env;
|
extern char *_nm_config_match_env;
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#define NM_CONFIG_DEVICE_STATE_DIR ""NMRUNDIR"/devices"
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
#endif /* __NETWORKMANAGER_CONFIG_H__ */
|
#endif /* __NETWORKMANAGER_CONFIG_H__ */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user