sysctl: eliminate a warning '-Wmisleading-indentation'
[ and in the affected function, we'll also eliminate ] [ all those f**king tab characters making a hot mess ] [ of any attempt at a properly formatted C function! ] [ plus i adjusted a little non-tab misalignment too! ] Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
parent
14281269f8
commit
7418b97344
50
sysctl.c
50
sysctl.c
@ -530,36 +530,36 @@ static int WriteSetting(
|
|||||||
const char *key,
|
const char *key,
|
||||||
const char *path,
|
const char *path,
|
||||||
const char *value,
|
const char *value,
|
||||||
const bool ignore_failure) {
|
const bool ignore_failure)
|
||||||
|
{
|
||||||
int rc = EXIT_SUCCESS;
|
int rc = EXIT_SUCCESS;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
struct stat ts;
|
struct stat ts;
|
||||||
|
|
||||||
if (!key || !path)
|
if (!key || !path)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
if (stat(path, &ts) < 0) {
|
if (stat(path, &ts) < 0) {
|
||||||
if (!IgnoreError) {
|
if (!IgnoreError) {
|
||||||
xwarn(_("cannot stat %s"), path);
|
xwarn(_("cannot stat %s"), path);
|
||||||
rc = EXIT_FAILURE;
|
rc = EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_proc_path(path)) {
|
if (!is_proc_path(path)) {
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ts.st_mode & S_IWUSR) == 0) {
|
if ((ts.st_mode & S_IWUSR) == 0) {
|
||||||
xwarn(_("setting key \"%s\""), key);
|
xwarn(_("setting key \"%s\""), key);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (S_ISDIR(ts.st_mode)) {
|
if (S_ISDIR(ts.st_mode)) {
|
||||||
xwarn(_("setting key \"%s\""), key);
|
xwarn(_("setting key \"%s\""), key);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DryRun) {
|
if (!DryRun) {
|
||||||
if ((fp = fprocopen(path, "w")) == NULL) {
|
if ((fp = fprocopen(path, "w")) == NULL) {
|
||||||
@ -568,10 +568,10 @@ static int WriteSetting(
|
|||||||
if (!IgnoreError) {
|
if (!IgnoreError) {
|
||||||
xwarnx(_("\"%s\" is an unknown key%s"),
|
xwarnx(_("\"%s\" is an unknown key%s"),
|
||||||
key, (ignore_failure?_(", ignoring"):""));
|
key, (ignore_failure?_(", ignoring"):""));
|
||||||
if (!ignore_failure)
|
if (!ignore_failure)
|
||||||
rc = EXIT_FAILURE;
|
rc = EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EPERM:
|
case EPERM:
|
||||||
case EROFS:
|
case EROFS:
|
||||||
case EACCES:
|
case EACCES:
|
||||||
@ -584,10 +584,10 @@ static int WriteSetting(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!ignore_failure && errno != ENOENT)
|
if (!ignore_failure && errno != ENOENT)
|
||||||
rc = EXIT_FAILURE;
|
rc = EXIT_FAILURE;
|
||||||
} else {
|
} else {
|
||||||
if (0 < fprintf(fp, "%s\n", value))
|
if (0 < fprintf(fp, "%s\n", value))
|
||||||
rc = EXIT_SUCCESS;
|
rc = EXIT_SUCCESS;
|
||||||
if (close_stream(fp) != 0) {
|
if (close_stream(fp) != 0) {
|
||||||
xwarn(_("setting key \"%s\""), path);
|
xwarn(_("setting key \"%s\""), path);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user