diff options
author | Mark Salyzyn <salyzyn@google.com> | 2014-03-07 15:08:20 -0800 |
---|---|---|
committer | Mark Salyzyn <salyzyn@google.com> | 2014-03-07 15:28:43 -0800 |
commit | 0425b64e0b72f0a77a496e35635e0bcb8083f535 (patch) | |
tree | b078463fd7a025b91662875afe7b5ce583cea4d5 | |
parent | 1367854a891090d1be1edfb12515691b20b350cf (diff) | |
download | core-0425b64e0b72f0a77a496e35635e0bcb8083f535.tar.gz core-0425b64e0b72f0a77a496e35635e0bcb8083f535.tar.bz2 core-0425b64e0b72f0a77a496e35635e0bcb8083f535.zip |
libcutils: 64-bit compile issues
- Use inttypes.h to print uint64_t values.
Change-Id: Ia10a3b67cadcce282563467a464ec07066cc2051
-rw-r--r-- | libcutils/qtaguid.c | 20 |
1 files changed, 11 insertions, 9 deletions
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 <cutils/qtaguid.h> -#include <cutils/log.h> #include <errno.h> #include <fcntl.h> +#include <inttypes.h> +#include <pthread.h> #include <stdio.h> #include <string.h> #include <unistd.h> -#include <pthread.h> + +#include <cutils/qtaguid.h> +#include <log/log.h> 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); } |