diff options
author | Mark Salyzyn <salyzyn@google.com> | 2014-03-07 23:33:30 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-03-07 23:33:31 +0000 |
commit | 0c3d19ff3db7b04081a7a729a81642c5903f741a (patch) | |
tree | 65a91e6c0a5686cb01fdec4769834b74c94af658 /libcutils | |
parent | 9f4d558e0c80602aa8707ec9d0bdd33a93aa4f16 (diff) | |
parent | 0425b64e0b72f0a77a496e35635e0bcb8083f535 (diff) | |
download | system_core-0c3d19ff3db7b04081a7a729a81642c5903f741a.zip system_core-0c3d19ff3db7b04081a7a729a81642c5903f741a.tar.gz system_core-0c3d19ff3db7b04081a7a729a81642c5903f741a.tar.bz2 |
Merge "libcutils: 64-bit compile issues"
Diffstat (limited to 'libcutils')
-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 5bb8176..899a7b4 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); } |