You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -2618,10 +2613,8 @@ static int determine_names(void) {
2618
2613
returnlog_error_errno(r, "Failed to determine current directory: %m");
2619
2614
}
2620
2615
2621
-
if (!arg_directory&& !arg_image) {
2622
-
log_error("Failed to determine path, please use -D or -i.");
2623
-
return-EINVAL;
2624
-
}
2616
+
if (!arg_directory&& !arg_image)
2617
+
returnlog_error_errno(SYNTHETIC_ERRNO(EINVAL), "Failed to determine path, please use -D or -i.");
2625
2618
}
2626
2619
2627
2620
if (!arg_machine) {
@@ -2644,10 +2637,8 @@ static int determine_names(void) {
2644
2637
returnlog_oom();
2645
2638
2646
2639
hostname_cleanup(arg_machine);
2647
-
if (!machine_name_is_valid(arg_machine)) {
2648
-
log_error("Failed to determine machine name automatically, please use -M.");
2649
-
return-EINVAL;
2650
-
}
2640
+
if (!machine_name_is_valid(arg_machine))
2641
+
returnlog_error_errno(SYNTHETIC_ERRNO(EINVAL), "Failed to determine machine name automatically, please use -M.");
2651
2642
2652
2643
if (arg_ephemeral) {
2653
2644
char*b;
@@ -2774,10 +2765,8 @@ static int patch_sysctl(void) {
2774
2765
break;
2775
2766
}
2776
2767
2777
-
if (!good) {
2778
-
log_error("Refusing to write to sysctl '%s', as it is not safe in the selected namespaces.", *k);
2779
-
return-EPERM;
2780
-
}
2768
+
if (!good)
2769
+
returnlog_error_errno(SYNTHETIC_ERRNO(EPERM), "Refusing to write to sysctl '%s', as it is not safe in the selected namespaces.", *k);
2781
2770
2782
2771
r=sysctl_write(*k, *v);
2783
2772
if (r<0)
@@ -4162,10 +4151,9 @@ static int run_container(int master,
4162
4151
log_debug_errno(r, "Cannot determine if passed network namespace path '%s' really refers to a network namespace, assuming it does.", arg_network_namespace_path);
4163
4152
elseif (r<0)
4164
4153
returnlog_error_errno(r, "Failed to check %s fs type: %m", arg_network_namespace_path);
4165
-
elseif (r==0) {
4166
-
log_error("Path %s doesn't refer to a network namespace, refusing.", arg_network_namespace_path);
4167
-
return-EINVAL;
4168
-
}
4154
+
elseif (r==0)
4155
+
returnlog_error_errno(SYNTHETIC_ERRNO(EINVAL),
4156
+
"Path %s doesn't refer to a network namespace, refusing.", arg_network_namespace_path);
4169
4157
}
4170
4158
4171
4159
*pid=raw_clone(SIGCHLD|CLONE_NEWNS);
@@ -4228,10 +4216,8 @@ static int run_container(int master,
0 commit comments