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,7 +81,8 @@ acquire_state_lock(const char *state_path, const char *lifname)
|
||||||
int fd = open(lockpath, O_CREAT | O_WRONLY | O_TRUNC);
|
int fd = open(lockpath, O_CREAT | O_WRONLY | O_TRUNC);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s: while opening lockfile %s: %s\n", argv0, lockpath, strerror(errno));
|
if (exec_opts.verbose)
|
||||||
|
fprintf(stderr, "%s: while opening lockfile %s: %s\n", argv0, lockpath, strerror(errno));
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +91,8 @@ acquire_state_lock(const char *state_path, const char *lifname)
|
||||||
{
|
{
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
fprintf(stderr, "%s: while getting flags for lockfile: %s\n", argv0, strerror(errno));
|
if (exec_opts.verbose)
|
||||||
|
fprintf(stderr, "%s: while getting flags for lockfile: %s\n", argv0, strerror(errno));
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,7 +101,8 @@ acquire_state_lock(const char *state_path, const char *lifname)
|
||||||
{
|
{
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
fprintf(stderr, "%s: while setting lockfile close-on-exec: %s\n", argv0, strerror(errno));
|
if (exec_opts.verbose)
|
||||||
|
fprintf(stderr, "%s: while setting lockfile close-on-exec: %s\n", argv0, strerror(errno));
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue