fix sign of error to be positive when passed to strerror() am: 5c06efb178
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/2121994
Change-Id: Ie1267fb56440775a93a8f977e58dbc6fd14c9d55
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/staticlibs/native/bpfmapjni/com_android_net_module_util_TcUtils.cpp b/staticlibs/native/bpfmapjni/com_android_net_module_util_TcUtils.cpp
index 073a46f..cb06afb 100644
--- a/staticlibs/native/bpfmapjni/com_android_net_module_util_TcUtils.cpp
+++ b/staticlibs/native/bpfmapjni/com_android_net_module_util_TcUtils.cpp
@@ -34,7 +34,7 @@
int error = isEthernet(interface.c_str(), result);
if (error) {
throwIOException(
- env, "com_android_net_module_util_TcUtils_isEthernet error: ", error);
+ env, "com_android_net_module_util_TcUtils_isEthernet error: ", -error);
}
// result is not touched when error is returned; leave false.
return result;
@@ -50,7 +50,7 @@
if (error) {
throwIOException(
env,
- "com_android_net_module_util_TcUtils_tcFilterAddDevBpf error: ", error);
+ "com_android_net_module_util_TcUtils_tcFilterAddDevBpf error: ", -error);
}
}
@@ -68,7 +68,7 @@
throwIOException(env,
"com_android_net_module_util_TcUtils_"
"tcFilterAddDevIngressPolice error: ",
- error);
+ -error);
}
}
@@ -80,7 +80,7 @@
if (error) {
throwIOException(
env,
- "com_android_net_module_util_TcUtils_tcFilterDelDev error: ", error);
+ "com_android_net_module_util_TcUtils_tcFilterDelDev error: ", -error);
}
}
@@ -92,7 +92,7 @@
if (error) {
throwIOException(
env,
- "com_android_net_module_util_TcUtils_tcQdiscAddDevClsact error: ", error);
+ "com_android_net_module_util_TcUtils_tcQdiscAddDevClsact error: ", -error);
}
}