Merge lp:~colin-king/ecryptfs/ecryptfs-fix-32bit-warnings into lp:ecryptfs

Proposed by Colin Ian King
Status: Merged
Merged at revision: 775
Proposed branch: lp:~colin-king/ecryptfs/ecryptfs-fix-32bit-warnings
Merge into: lp:ecryptfs
Diff against target: 76 lines (+7/-6)
4 files modified
src/libecryptfs/ecryptfs-stat.c (+1/-1)
tests/kernel/extend-file-random/test.c (+2/-2)
tests/kernel/inode-race-stat/test.c (+3/-2)
tests/kernel/trunc-file/test.c (+1/-1)
To merge this branch: bzr merge lp:~colin-king/ecryptfs/ecryptfs-fix-32bit-warnings
Reviewer Review Type Date Requested Status
eCryptfs Pending
Review via email: mp+153163@code.launchpad.net

Description of the change

Fixed some 32 bit build warnings

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/libecryptfs/ecryptfs-stat.c'
--- src/libecryptfs/ecryptfs-stat.c 2009-02-09 17:29:17 +0000
+++ src/libecryptfs/ecryptfs-stat.c 2013-03-13 15:03:25 +0000
@@ -146,7 +146,7 @@
146 if (buf_size < (ECRYPTFS_FILE_SIZE_BYTES146 if (buf_size < (ECRYPTFS_FILE_SIZE_BYTES
147 + MAGIC_ECRYPTFS_MARKER_SIZE_BYTES147 + MAGIC_ECRYPTFS_MARKER_SIZE_BYTES
148 + 4)) {148 + 4)) {
149 printf("%s: Invalid metadata size; must have at least [%lu] "149 printf("%s: Invalid metadata size; must have at least [%zu] "
150 "bytes; there are only [%zu] bytes\n", __FUNCTION__,150 "bytes; there are only [%zu] bytes\n", __FUNCTION__,
151 (ECRYPTFS_FILE_SIZE_BYTES151 (ECRYPTFS_FILE_SIZE_BYTES
152 + MAGIC_ECRYPTFS_MARKER_SIZE_BYTES152 + MAGIC_ECRYPTFS_MARKER_SIZE_BYTES
153153
=== modified file 'tests/kernel/extend-file-random/test.c'
--- tests/kernel/extend-file-random/test.c 2012-01-31 16:24:09 +0000
+++ tests/kernel/extend-file-random/test.c 2013-03-13 15:03:25 +0000
@@ -48,7 +48,7 @@
48 }48 }
4949
50 if (write(fd, buffer, len) != len) {50 if (write(fd, buffer, len) != len) {
51 fprintf(stderr, "Failed to write %lu bytes, position %lu: %s\n", 51 fprintf(stderr, "Failed to write %zu bytes, position %lu: %s\n",
52 len, offset, strerror(errno));52 len, offset, strerror(errno));
53 return TEST_FAILED;53 return TEST_FAILED;
54 }54 }
@@ -64,7 +64,7 @@
64 }64 }
6565
66 if (read(fd, buffer, len) != len) {66 if (read(fd, buffer, len) != len) {
67 fprintf(stderr, "Failed to read %lu bytes, position %lu: %s\n", 67 fprintf(stderr, "Failed to read %zu bytes, position %lu: %s\n",
68 len, offset, strerror(errno));68 len, offset, strerror(errno));
69 return TEST_FAILED;69 return TEST_FAILED;
70 }70 }
7171
=== modified file 'tests/kernel/inode-race-stat/test.c'
--- tests/kernel/inode-race-stat/test.c 2012-07-19 17:16:43 +0000
+++ tests/kernel/inode-race-stat/test.c 2013-03-13 15:03:25 +0000
@@ -34,6 +34,7 @@
34#include <stdlib.h>34#include <stdlib.h>
35#include <stdbool.h>35#include <stdbool.h>
36#include <string.h>36#include <string.h>
37#include <stdint.h>
3738
38#include <unistd.h>39#include <unistd.h>
39#include <fcntl.h>40#include <fcntl.h>
@@ -122,7 +123,7 @@
122 if (cmd[0] == CMD_TEST) {123 if (cmd[0] == CMD_TEST) {
123 int ret;124 int ret;
124 off_t sz;125 off_t sz;
125 sscanf(cmd+1, "%zd", &sz);126 sscanf(cmd+1, "%jd", (intmax_t *)&sz);
126127
127 ret = check_size(filename, sz);128 ret = check_size(filename, sz);
128 switch (ret) {129 switch (ret) {
@@ -307,7 +308,7 @@
307 }308 }
308309
309 /* Now tell children to stat the file */310 /* Now tell children to stat the file */
310 snprintf(cmd, sizeof(cmd), "%c%zd", CMD_TEST, sz);311 snprintf(cmd, sizeof(cmd), "%c%jd", CMD_TEST, (intmax_t)sz);
311 for (i = 0; i < threads; i++) {312 for (i = 0; i < threads; i++) {
312 if (write(pipe_to[i][1], cmd, strlen(cmd)+1) < 0) {313 if (write(pipe_to[i][1], cmd, strlen(cmd)+1) < 0) {
313 fprintf(stderr, "write to pipe failed: %s\n",314 fprintf(stderr, "write to pipe failed: %s\n",
314315
=== modified file 'tests/kernel/trunc-file/test.c'
--- tests/kernel/trunc-file/test.c 2012-01-31 17:10:46 +0000
+++ tests/kernel/trunc-file/test.c 2013-03-13 15:03:25 +0000
@@ -272,7 +272,7 @@
272272
273 len *= 1024;273 len *= 1024;
274 if (len > SSIZE_MAX) {274 if (len > SSIZE_MAX) {
275 fprintf(stderr, "size should be < %zd\n", SSIZE_MAX / 1024);275 fprintf(stderr, "size should be < %zd\n", (ssize_t)SSIZE_MAX / 1024);
276 exit(TEST_ERROR);276 exit(TEST_ERROR);
277 }277 }
278278

Subscribers

People subscribed via source and target branches