ifupdown: only show granular locking errors in verbose mode
This commit is contained in:
parent
ef3bdd79da
commit
58bc969bbb
1 changed files with 6 additions and 3 deletions
|
@ -81,6 +81,7 @@ acquire_state_lock(const char *state_path, const char *lifname)
|
|||
int fd = open(lockpath, O_CREAT | O_WRONLY | O_TRUNC);
|
||||
if (fd < 0)
|
||||
{
|
||||
if (exec_opts.verbose)
|
||||
fprintf(stderr, "%s: while opening lockfile %s: %s\n", argv0, lockpath, strerror(errno));
|
||||
return -2;
|
||||
}
|
||||
|
@ -90,6 +91,7 @@ acquire_state_lock(const char *state_path, const char *lifname)
|
|||
{
|
||||
close(fd);
|
||||
|
||||
if (exec_opts.verbose)
|
||||
fprintf(stderr, "%s: while getting flags for lockfile: %s\n", argv0, strerror(errno));
|
||||
return -2;
|
||||
}
|
||||
|
@ -99,6 +101,7 @@ acquire_state_lock(const char *state_path, const char *lifname)
|
|||
{
|
||||
close(fd);
|
||||
|
||||
if (exec_opts.verbose)
|
||||
fprintf(stderr, "%s: while setting lockfile close-on-exec: %s\n", argv0, strerror(errno));
|
||||
return -2;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue