diff options
| author | Roy Marples <roy@marples.name> | 2016-04-26 20:09:34 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2016-04-26 20:09:34 +0000 |
| commit | d4b2fdf14a88ebf31da15c50156a6a7cd62dde5c (patch) | |
| tree | deb0f7b73cb18cbf2d52ce46970590a32a901eff /dhcpcd.c | |
| parent | cc3bb3850c3aae72fe9bfa92b0cdc95caf1e909a (diff) | |
| download | dhcpcd-d4b2fdf14a88ebf31da15c50156a6a7cd62dde5c.tar.xz | |
Revert prior and just move the RUNDIR check above pidfile_lock.
Diffstat (limited to 'dhcpcd.c')
| -rw-r--r-- | dhcpcd.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1790,6 +1790,12 @@ printpidfile: } if (!(ctx.options & DHCPCD_TEST)) { + /* Ensure we have the needed directories */ + if (mkdir(RUNDIR, 0755) == -1 && errno != EEXIST) + logger(&ctx, LOG_ERR, "mkdir `%s': %m", RUNDIR); + if (mkdir(DBDIR, 0755) == -1 && errno != EEXIST) + logger(&ctx, LOG_ERR, "mkdir `%s': %m", DBDIR); + if ((pid = pidfile_lock(ctx.pidfile)) != 0) { if (pid == -1) logger(&ctx, LOG_ERR, "%s: pidfile_lock: %m", @@ -1800,12 +1806,6 @@ printpidfile: pid, ctx.pidfile); goto exit_failure; } - - /* Ensure we have the needed directories */ - if (mkdir(RUNDIR, 0755) == -1 && errno != EEXIST) - logger(&ctx, LOG_ERR, "mkdir `%s': %m", RUNDIR); - if (mkdir(DBDIR, 0755) == -1 && errno != EEXIST) - logger(&ctx, LOG_ERR, "mkdir `%s': %m", DBDIR); } if (ctx.options & DHCPCD_MASTER) { |
