diff --git a/libcutils/qtaguid.c b/libcutils/qtaguid.c index 5bb81761e..899a7b44f 100644 --- a/libcutils/qtaguid.c +++ b/libcutils/qtaguid.c @@ -19,14 +19,16 @@ #define LOG_TAG "qtaguid" -#include -#include #include #include +#include +#include #include #include #include -#include + +#include +#include static const char* CTRL_PROCPATH = "/proc/net/xt_qtaguid/ctrl"; static const int CTRL_MAX_INPUT_LEN = 128; @@ -103,13 +105,13 @@ int qtaguid_tagSocket(int sockfd, int tag, uid_t uid) { pthread_once(&resTrackInitDone, qtaguid_resTrack); - snprintf(lineBuf, sizeof(lineBuf), "t %d %llu %d", sockfd, kTag, uid); + snprintf(lineBuf, sizeof(lineBuf), "t %d %" PRIu64 " %d", sockfd, kTag, uid); - ALOGV("Tagging socket %d with tag %llx{%u,0} for uid %d", sockfd, kTag, tag, uid); + ALOGV("Tagging socket %d with tag %" PRIx64 "{%u,0} for uid %d", sockfd, kTag, tag, uid); res = write_ctrl(lineBuf); if (res < 0) { - ALOGI("Tagging socket %d with tag %llx(%d) for uid %d failed errno=%d", + ALOGI("Tagging socket %d with tag %" PRIx64 "(%d) for uid %d failed errno=%d", sockfd, kTag, tag, uid, res); } @@ -147,14 +149,14 @@ int qtaguid_deleteTagData(int tag, uid_t uid) { int fd, cnt = 0, res = 0; uint64_t kTag = (uint64_t)tag << 32; - ALOGV("Deleting tag data with tag %llx{%d,0} for uid %d", kTag, tag, uid); + ALOGV("Deleting tag data with tag %" PRIx64 "{%d,0} for uid %d", kTag, tag, uid); pthread_once(&resTrackInitDone, qtaguid_resTrack); - snprintf(lineBuf, sizeof(lineBuf), "d %llu %d", kTag, uid); + snprintf(lineBuf, sizeof(lineBuf), "d %" PRIu64 " %d", kTag, uid); res = write_ctrl(lineBuf); if (res < 0) { - ALOGI("Deleteing tag data with tag %llx/%d for uid %d failed with cnt=%d errno=%d", + ALOGI("Deleting tag data with tag %" PRIx64 "/%d for uid %d failed with cnt=%d errno=%d", kTag, tag, uid, cnt, errno); }